forked from jrad2017/gs4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHealBot.lic
128 lines (123 loc) · 5.26 KB
/
HealBot.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
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
121
122
123
124
125
126
127
128
# Heal bot
#Speaking Heal Regex by Gib
#Small modifications by Auryana.
# v 0.75 beta
friendlist = ["Ericos", "Predest", "Archaeron", "Fijitus", "Istoriel"]
def gd_wound_transfer(person)
fput "appraise #{person}"
line = matchtimeout 5, "You take a quick appraisal of "
if line !~ /You take a quick appraisal of/ then return end
wounds = []
if line =~ /head/ then wounds.push "head" end
if line =~ /neck/ then wounds.push "neck" end
if line =~ /right eye/ then wounds.push "right eye" end
if line =~ /left eye/ then wounds.push "left eye" end
if line =~ /back/ then wounds.push "back" end
if line =~ /chest/ then wounds.push "chest" end
if line =~ /abdomen|abdominal/ then wounds.push "abdomen" end
if line =~ /left arm/ then wounds.push "left arm" end
if line =~ /right arm/ then wounds.push "right arm" end
if line =~ /left hand/ then wounds.push "left hand" end
if line =~ /right hand/ then wounds.push "right hand" end
if line =~ /left leg/ then wounds.push "left leg" end
if line =~ /right leg/ then wounds.push "right leg" end
if line =~ /twitching|convulsions/ then wounds.push "nerves" end
if line =~ /no apparent injuries/ then wounds = [] end
wounds.each do |wound|
put "transfer #{person} #{wound}"
pause("0.25s")
end
if line !~ /no apparent injuries/
line = "You take some of sombody's blood loss."
while checkhealth > 75 and line =~ /some of .+ blood loss/
fput "transfer #{person}"
line = matchwait "You take", "Nothing happens."
end
end
end
def healbot_cure(cureloc, curemana)
curelevel = curemana
curelevel -= 4 if curelevel > 14
wait_while { checkrt > 0 or checkcastrt > 0 }
if checkmana(curemana) and Char.prof == "Empath" and Char.level >= curelevel and Spells.empath >= curelevel
fput "cure #{cureloc}"
pause("2s")
return false
end
wait_while { checkrt > 0 or checkcastrt > 0 }
return true
end
def healbot_healme(type, dtr)
if checkhealth < maxhealth then healbot_cure("", 1) end
dtr = 3 if dtr > 3
dtr = 1 if dtr < 1
if type == "Wounds"
dtr.times { |m|
n = [3, 2, 1][m]
x = [5, 5, 0][m]
if Wounds.head == n then healbot_cure("head", 4+x) end
if Wounds.neck == n then healbot_cure("neck", 4+x) end
if Wounds.chest == n then healbot_cure("chest", 5+x) end
if Wounds.abdomen == n then healbot_cure("abdomen", 5+x) end
if Wounds.leftArm == n then healbot_cure("left arm", 2+x) end
if Wounds.rightArm == n then healbot_cure("right arm", 2+x) end
if Wounds.leftLeg == n then healbot_cure("left leg", 2+x) end
if Wounds.rightLeg == n then healbot_cure("right leg", 2+x) end
if Wounds.back == n then healbot_cure("back", 5+x) end
if Wounds.leftHand == n then healbot_cure("left hand", 2+x) end
if Wounds.rightHand == n then healbot_cure("right hand", 2+x) end
if Wounds.nerves == n then healbot_cure("nerves", 3+x) end
if Wounds.leftEye == n then healbot_cure("left eye", 5+x) end
if Wounds.rightEye == n then healbot_cure("right eye", 5+x) end
}
elsif type == "Scars"
dtr.times { |m|
n = [3, 2, 1][m]
x = [4, 4, 0][m]
if Scars.head == n then healbot_cure("head", 13+x) end
if Scars.neck == n then healbot_cure("neck", 13+x) end
if Scars.chest == n then healbot_cure("chest", 14+x) end
if Scars.abdomen == n then healbot_cure("abdomen", 14+x) end
if Scars.leftArm == n then healbot_cure("left arm", 11+x) end
if Scars.rightArm == n then healbot_cure("right arm", 11+x) end
if Scars.leftLeg == n then healbot_cure("left leg", 11+x) end
if Scars.rightLeg == n then healbot_cure("right leg", 11+x) end
if Scars.back == n then healbot_cure("back", 14+x) end
if Scars.leftHand == n then healbot_cure("left hand", 11+x) end
if Scars.rightHand == n then healbot_cure("right hand", 11+x) end
if Scars.nerves == n then healbot_cure("nerves", 12+x) end
if Scars.leftEye == n then healbot_cure("left eye", 14+x) end
if Scars.rightEye == n then healbot_cure("right eye", 14+x) end
}
end
end
############################################################################################################
lastscantime = Time.now
loop {
line = matchtimeout 15, "whispers", "asks", "exclaims", "says", "just"
if line =~ /(?:^Speaking .*to )?(you, |[A-Z][a-z]+, )?(?:The ghostly voice of |The ghost of )?([A-Z][a-z]+).*(whispers,|asks,|exclaims,|says,)(?i).*?(heal[^t]|bleed|minor|'?ealing?|lacerations|cuts|wound|patch|empath|poison|disease|medic).*?(?:\.|\!|\?)\"|([A-Z][a-z]+) meditates over.*/i
target = $1
healee = $2
waittime = 2
if target =~ /you/
else ; waittime += 2 ; end
pause("#{waittime}s")
gd_wound_transfer(healee)
elsif line =~ /^([A-Z,a-z]+)('s group | )(just arrived|just came crawling in|just limped in|just came marching in|just came sashaying in gracefully|just arrived, skipping merrily|just tiptoed in|just strode in|just stumbled in|just came trudging in)/
healee = $1
if friendlist.include?(healee)
pause("1s")
gd_wound_transfer(healee)
end
elsif (Time.now - lastscantime > 15)
lastscantime = Time.now
friendlist.each { |peep|
if checkpcs.include?(peep) and !(peep.status =~ /dead/)
pause("1s")
gd_wound_transfer(peep)
end
}
end
healbot_healme("Wounds", 3)
healbot_healme("Scars", 3)
}