forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gbox.lic
42 lines (32 loc) · 1.25 KB
/
gbox.lic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#gbox
=end
custom_require.call(%w(common events))
class GiveBoxes
include DRC
def initialize
arg_definitions = [
[
{ name: 'container', regex: /\w+/i, variable: true, description: 'Name of the container to get boxes from' },
{ name: 'player', regex: /\w+/i, variable: true, description: 'Name of the player to give boxes to' }
]
]
args = parse_args(arg_definitions)
Flags.add('give-accepted', '.* has accepted your offer and is now holding .*')
Flags.add('give-declined', '.* has declined the offer')
Flags.add('give-expired', 'Your offer to .* has expired')
get_boxes(args.container).each { |item| hand_over(args.container, item, args.player) }
end
def hand_over(container, item, person)
fput("get my #{item} from my #{container}")
Flags.reset('give-accepted')
Flags.reset('give-expired')
Flags.reset('give-declined')
bput("give #{item} to #{person}", '^You offer your .* to')
pause 0.5 until Flags['give-accepted'] || Flags['give-expired'] || Flags['give-declined']
return unless Flags['give-expired'] || Flags['give-declined']
bput('stow right', 'You put')
exit
end
end
GiveBoxes.new