-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAFK.Cmd
120 lines (120 loc) · 6.4 KB
/
AFK.Cmd
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#<=============================================================================================>#
#< AFK KEEPALIVE SCRIPT - BY ~PELIC >#
#<=============================================================================================>#
# Last Update: 19 November, 2011
#<--------------------------------------------------------------------------------------------->#
ABSOLUTE.TOP:
gosub BASE.ACTIONS
gosub STATUSBAR
var Current.Script afk
#<---------------------------------------------------------------------------------------->#
INIT:
counter set 0
#<=============================================================================================>#
#< COUNTING LOOP >#
#<=============================================================================================>#
SCRIPT.BEGIN:
LOOP:
pause 60
send look
pause 0.5
counter add 1
echo
echo *** AFK / Keep Alive Script Running
echo
put #statusbar 5 Idle %c minutes.
goto LOOP
#<=============================================================================================>#
#< STATUSBAR UPDATE SUBROUTINE >#
#<=============================================================================================>#
STATUSBAR:
put #statusbar 2 AFK Keep Alive Script (AFK.Cmd)
put #statusbar 3 Type STOP to abort script.
put #statusbar 4
put #statusbar 5
return
#<---------------------------------------------------------------------------------------->#
STATUSBAR.CLEAR:
put #statusbar 2
put #statusbar 3
put #statusbar 4
put #statusbar 5
return
#<=============================================================================================>#
#< END SCRIPT SUBROUTINE >#
#<=============================================================================================>#
END.SCRIPT:
action clear
gosub clear
pause 0.3
gosub STATUSBAR.CLEAR
put #parse SCRIPT ABORTED!
put #script abort %Current.Script
exit
#<=============================================================================================>#
#< BASE ACTIONS >#
#<=============================================================================================>#
BASE.ACTIONS:
action clear
#<---------------------------------------------------------------------------------------->#
#< Trigger to end script. >#
#<---------------------------------------------------------------------------------------->#
action goto END.SCRIPT when ^What do you want to stop\?
#<---------------------------------------------------------------------------------------->#
#< Trigger to prevent idling out. >#
#<---------------------------------------------------------------------------------------->#
action send LOOK when eval $useridle = 1
action send LOOK when ^YOU HAVE BEEN IDLE TOO LONG\. PLEASE RESPOND\.$
#<---------------------------------------------------------------------------------------->#
#< Trigger to Feed Caravan. >#
#<---------------------------------------------------------------------------------------->#
action send REMOVE FEEDBAG;send GIVE CARAVAN;send WEAR FEEDBAG when ^The caravan driver watches with satisfaction as the animals in his care finish off the last of their feed\.$
action send REMOVE FEEDBAG;send GIVE CARAVAN;send WEAR FEEDBAG when ^The driver of your caravan calls over to you\, \"They are done with that last bit of feed, (?:sir|madam)\!\"$
#<---------------------------------------------------------------------------------------->#
#< Triggers to initiate Panic Exit subroutine. >#
#<---------------------------------------------------------------------------------------->#
action goto EXIT.NOW when ^(\w+) reaches over and holds your hand\.
action goto EXIT.NOW when ^(\w+) clasps your hand tenderly\.
action goto EXIT.NOW when ^(\w+) grabs your arm and drags you.*\.
action goto EXIT.NOW when ^(\w+) grabs your arm and tries to drag you, but you resist and stand firm\.
action goto EXIT.NOW when ^\[You're .*\.\]$ .+\.\]$
action goto EXIT.NOW when eval $dead = 1
action goto EXIT.NOW when eval $health < 50
action goto EXIT.NOW when eval $webbed = 1
action goto EXIT.NOW when eval $stunned = 1
action goto EXIT.NOW when eval $bleeding = 1
action goto EXIT.NOW when eval $diseased = 1
action goto EXIT.NOW when eval $poisoned = 1
return
#<=============================================================================================>#
#< PANIC EXIT SUBROUTINE >#
#<=============================================================================================>#
EXIT.NOW:
action clear
gosub QUIT
pause 0.3
echo
echo
echo **** PANIC EXIT INITIATED ****
echo
echo
pause 0.3
put #script abort %Current.Script
exit
#<=============================================================================================>#
#< QUIT SUBROUTINE >#
#<=============================================================================================>#
QUIT:
matchre QUIT ^\.\.\.wait\s+\d+\s+sec(?:onds|s)?\.?$
matchre QUIT ^Sorry,
matchre RETURN ^\[\d+\:\d+\] Connection closed\.
put QUIT
matchwait
#<=============================================================================================>#
#< GENERIC RETURN >#
#<=============================================================================================>#
RETURN:
return
#<=============================================================================================>#
#< END OF SCRIPT >#
#<=============================================================================================>#