PDA

View Full Version : Healing scripts not working.



FlayedAngel
03-21-2017, 02:08 AM
I've been having the occasional hang-up with healing scripts, for some odd reason; happened before, but it apparently fixed itself... not sure what I did, but it's back again.

The issue seems to come from it not recognizing APPRAISE, maybe? It seems to hang up on that part without actually doing the healing, and I'd then have to kill the script to run it again... same deal. I was using ;heal mostly, but I've tried a couple of other with similar results. Any thoughts?

Apparently the issue is not inherent only to me, someone else mentioned having a problem that sounded identical recently.

Tgo01
03-21-2017, 02:35 AM
Yeah I had the same problem too. Forgot how I fixed it though :/

FlayedAngel
03-22-2017, 11:59 PM
Yeah, none of the healing scripts I know of are working, which is... weird.

Tgo01
03-23-2017, 12:08 AM
Have you also tried ;sheal? That's the one I used but I modified it a bit.

FlayedAngel
03-23-2017, 12:13 AM
Seems like it may be a bigger issue with Lich sputtering out... not sure why?

drauz
03-23-2017, 12:18 AM
Seems like it may be a bigger issue with Lich sputtering out... not sure why?

So you are an empath trying to use the script to heal someone else correct?

drauz
03-23-2017, 12:42 AM
This is the version of ;heal I am using and I just tried it on one person and it seemed to work fine.

What exactly are you trying to have it do?


# REQUIRED: Lich v2.88+ if you use Wizard, or Lich v3.37+ if you use StormFront
# Script for empaths to heal a target, then themselves. Basically, it clones the infamous JSE script (I think it works exactly the same, anyway... I've never used JSE, have never been an empath, and wrote it by request to suit the guy who asked for it, so who knows).

# This is the level of wound you want the script to stop at... 1 would be a minor wound (rank 1). If you'd like it to go all the way to fully healed, just change the line so that the number is 0 instead of 1.
#
# Edited by Tayre. It's faster now.
#
if Char.level >= 25
stop_at = 1
else
stop_at = 0
end

# The command 'quiet_exit' just tells Lich that it shouldn't clutter your game window when the script ends by informing you it exited.
#quiet_exit

# This checks to make sure the user gave us a name of a target to act on ('script.vars' is an array of the words the user entered after the script name, and calling the 'empty?' method of an array asks if the array is empty or not).
if script.vars.empty?
respond("You didn't supply a target! You need to tell me who to heal.")
exit
end
pause_script("knewhealbot")
# This sounds a whole lot more complicated than it really is, but the following defines a 'procedure object' -- what it does is wrap up everything in the block (the 'block' is what's between the opening squiggly '{' and the closing one '}'). Once you've defined a procedure object, you can call the object and execute it at anytime, as many times as you want, by just calling the 'call' method of procedures. So basically, 'healdown = proc' means, 'make a variable called healdown, and put the following procedure object into it'. Once that's done, you can execute the procedure with the command 'healdown.call' (for anyone familiar with JSE, I *believe*, but am not positive, there's a JSE function named 'callsub' -- the name sounds like it's doing the same thing as this, which is more or less executing a subroutine; if it helps, think of this as declaring the label for 'callsub' to execute [I think JSE works that way?]).
healdown = proc { |area|
if area =~ /head|neck/
spell = 1104
if Wounds.neck > 1 then cost = 9 else cost = 4 end
elsif area =~ /hand|arm|leg/
spell = 1102
if Wounds.limbs > 1 then cost = 7 else cost = 2 end
elsif area =~ /eye|ab|chest|back/
spell = 1105
if Wounds.torso > 1 then cost = 10 else cost = 5 end
elsif area =~ /nerve/
spell = 1103
if Wounds.nerves > 1 then cost = 8 else cost = 3 end
end
unless mana?(cost)
respond("Insufficient mana, will continue when you have enough...")
until mana?(cost)
sleep 1
end
end
# fput "prep #{spell}"
fput "cure #{area}"
sleep 3
waitrt?
}

# Another procedure object that will be called later on in the script. I'm a big fan of the 'DRY' principle (Don't Repeat Yourself), so I like to write things just once and then repeat them with a single line instead of having to write them over & over again anytime I want to do the same thing.
translate_wound = proc { |wound|
wound = wound.split.join(' ')
if wound =~ /(l|r)(?:eft|ight) (arm|hand|leg|eye)/
Wounds.send("#{$1}#{$2}")
elsif wound =~ /abdom/
Wounds.send("abs")
elsif wound =~ /nerve/
Wounds.send('nerves')
elsif wound =~ /(head|neck)/
Wounds.send($1)
elsif wound =~ /(chest|back)/
Wounds.send($1)
end
}

script.vars.shift
until script.vars.empty?
# This puts the name the user entered into a variable named 'target' (script.vars is the array of words the user gave us, and [1] means word 1; 'script.vars[2]' would ask for the second word the user gave the script, and so on).
target = script.vars.shift
fput "appraise #{target}"

# Now we wait for the result of the 'appraise (person)' command by using 'waitfor', which takes as many lines to wait for as you want (there's no limit to how many). When it finds a line that contains one of the strings (a string is just text... this comment, for instance, is a 'string') you gave it, it returns the entire matching game line. So 'wound_line = waitfor' waits for a matching line, and then sticks the matching line into the 'wound_line' variable.
wound_line = waitfor("Appraise what", "You take a quick appraisal of ")
#echo wound_line

# The 'waitfor' command does it for you automatically, but if you want to test if a string has a certain snippet inside it or not (like 'hi there' contains the snippet 'there', etc.), the easiest way is to use a regular expression match -- there's a hundred useful ways to use regular expressions, but if you don't want to get complicated, you can just ignore them all (see the comments in 'spell-list.txt' in your Lich scripts directory for more info on regular expressions). In Lich, anything inbetween two '/' characters is made a regular expression, and you can match by using the '=~' operator. So that's what this next line is about... it literally means "if the line in the 'wound_line' variable contains 'Appraise what' somewhere in it" -- if you want to, you can also do the same thing by using labels and 'match' lines the way Wizard scripts do it instead of using the method seen here.
if wound_line =~ /Appraise what/
respond("Couldn't find the target! Are you sure '#{target}' is here...?")
unpause_script("knewhealbot")
exit
elsif wound_line =~ /no apparent/
respond("dum dum dum, not injured, exiting")
unpause_script("knewhealbot")
exit
end

# Here we exploit a feature of regular expressions, which is automatically setting certain variables based on a succesful regular expression match -- for instance, enclosing something in parentheses is a quick and easy way of 'slicing' out whatever is between the opening '(' and the closing ')'. Each one gets put into a matching '$1' or '$2' or however many you have (in the following, if we added a second set of characters inside parentheses, whatever was in that part of the sentence would be in '$2' for example). All this does is extract the person's full name and use that as the target, instead of the (probably abbreviated) name the user entered.
if wound_line =~ /You take a quick appraisal of (\w+)/
target = $1.dup
end

if wound_line.include?(',')
wound_array = wound_line.split(/You take a quick appraisal of|,/)
else
wound_array = wound_line.scan(/a (?:blinded|swollen|bruised) (?:left|right) eye|deep lacerations across (?:his|her) \w+|deep gashes and serious bleeding (?:on|from|across) (?:his|her) \w+|minor cuts and bruises on (?:his|her) (?:left|right) (?:hand|arm|leg)|a (?:fractured and bleeding|completely severed) (?:left|right) (?:hand|arm|leg)|moderate bleeding from (?:his|her) neck|snapped bones and serious bleeding from the neck|minor bruises on (?:his|her) neck|minor (?:bruises|lacerations) about the head|minor cuts and bruises on (?:his|her) (?:chest|back|abdominal area)|severe head trauma and bleeding from the ears|strange case of muscle twitching|case of (?:sporadic|uncontrollable) convulsions/)
end

# This creates a new, empty array and puts it into the 'wounds' variable
wounds = Array.new

# This takes the line containing all the person's wounds that we've '.split' up into an array, and for '.each' value in the array, executes the entire block (as mentioned above, a 'block' is the code inside the squiggly brackets). We have to know how to refer to each value of the array uniquely, but we want to do the same exact thing for every one -- so when we declare the opening of the block with the squiggly '{' we also declare that inside the block, we want the current value to be in the variable 'wound'. That's what '|wound|' does.
wound_array.each { |wound|
if wound =~ /(a blinded|a swollen|a bruised|deep lacerations across his|deep lacerations across her|cuts and bruises on his|cuts and bruises on her|fractured and bleeding|completely severed|deep gashes and serious bleeding on his|deep gashes and serious bleeding on her|deep gashes and serious bleeding from his|deep gashes and serious bleeding from her) (\w+)( \w+)?/
bodypart = "#{$2.dup} #{$3.dup}"
elsif wound =~ /moderate bleeding from (his|her) neck|snapped bones and serious bleeding from the neck|minor bruises on (his|her) neck/
bodypart = "neck"
elsif wound =~ /minor bruises about the head|minor lacerations about the head|severe head trauma and bleeding from the ears/
bodypart = "head"
elsif wound =~ /strange case of muscle twitching|case of sporadic convulsions|case of uncontrollable convulsions/
bodypart = "nerves"
else
# If this particular value in the array doesn't match any of the regular expressions above (again, see 'spell-list.txt' for details on regular expressions), then we don't know what wound it is and have no idea what to do with it -- so to avoid it being part of our finished wound stack (the 'wounds' array), we use the 'next' command, which skips anything else left inside a block and moves on to the next iteration (an 'iteration' is the name for each time the code inside a block is executed -- so skipping the rest of the code and moving to the next 'iteration', in this case, means just keep going and repeat the code block for the next value in the array).
next
end

# Now that we've identified which wound we're dealing with (that's what the 'if/elsif' stuff above is about), we '.push' the result on to our 'wounds' array
wounds.push(bodypart)
}


# Since the previous code block is pretty advanced compared to Wizard scripts, let me try to clarify: at this point in the script (when Lich has gotten to the line that this comment is on), the above code block has been executed for every value in the 'wound_array' variable. The 'wound_array' variable is, as the name suggests, an 'array' of values, and each value happens to be the description of a given wound ('a fractured and bleeding right leg', for instance). So for every one of those lines, the code block was executed, and each time the 'wound' variable was replaced with the current value. So if the wound_array was an array containing the strings, 'cuts and bruises on his left leg', and 'a fractured and bleeding right arm', the 'wound' variable would contain the string 'cuts and bruises on his left leg' the first time the block was executed, then the second time it was executed, the 'wound' variable would contain 'a fractured and bleeding right arm'. I hope that helps clear up what it did.

# If the 'wound_array' variable was an empty array, or if none of the strings it contained could be identified as meaning a person had a certain wound, then our 'wounds' variable will be an empty array (because the 'wounds.push(bodypart)' line from the above code block never got to be executed). This just checks to make sure there's something inside 'wounds' for us to be working on.

# This just creates yet another empty array, and sticks it into another variable (here we use 'to_heal'). If you haven't stumbled on the info yet, in Lich, you can create a variable with any name you want by doing this, and make it equal anything you want (just make sure you don't try to make a variable with the same name as a command, otherwise you're going to get cryptic-sounding errors about 'no method for =' and so forth).
to_heal = Array.new

# Now we again call '.each', but this time, we want to use the 'wounds' array. We again use the 'wound' variable for each value of the array, but we could make up any variable name we wanted -- 'thingiemajig', 'myvariable', 'you_suck', whatever name you want the variable to have, just as long as it's one word.
wounds.each { |wound|
wound = wound.split.join(' ')
if wound =~ /(l|r)(?:eft|ight) (arm|hand|leg|eye)/
to_heal.push(wound)
if Wounds.send("#{$1}#{$2}") == 3
healdown.call(wound)
end
fput "transfer #{target} #{wound}"

elsif wound =~ /abdom/
to_heal.push('abdomen')
if Wounds.send("abs") == 3
healdown.call('abdomen')
end
fput "transfer #{target} abdomen"
sleep 1
elsif wound =~ /nerve/
to_heal.push('nerves')
if Wounds.send('nerves') == 3
healdown.call('nerves')
end
fput "transfer #{target} nerves"
sleep 1
elsif wound =~ /(head|neck)/
to_heal.push($1)
if Wounds.send($1) == 3
healdown.call($1)
end
fput "transfer #{target} #{$1}"

elsif wound =~ /(chest|back)/
to_heal.push($1)
if Wounds.send($1) == 3
healdown.call($1)
end
put "transfer #{target} #{$1}"

end
}

# Now we make a new variable called 'bloodline' and put an empty 'string' in it.
bloodline = String.new

# This is the same kind of concept as 'array.each' -- except 'until' keeps repeating code over & over again, without any limit to how many times, 'until' something is true. In this case, we ask it to repeat the code until the value of 'bloodline' is a string containing 'Nothing happens' or 'all', OR the value of 'health?' is less than or equal to 75 ('health?' is a Lich command which means your current health).
until bloodline =~ /Nothing happens|all|want/
if health? <= 75 or percenthealth < 51
if mana?((maxhealth - health?) / 10)
# fput "prep 1101"
fput "cure"
sleep 3
waitrt?
next
else
respond("You have insufficient health to safely continue, and insufficient mana to heal yourself... please handle the situation manually.")
break
end
end
# if health? <= 75
# respond("You have insufficient health to safely continue, and insufficient mana to heal yourself... please handle the situation manually.")
# break
# end
fput "transfer #{target}"
bloodline = waitfor "Nothing happens", "You take some", "You take all", "want"
end

# 'percenthealth' is another Lich command, and it's just the percentage of your current health. So now we say, "until we have 100% health, keep doing this over & over".
while (health?.to_i != 0) and (health?.to_i < maxhealth.to_i)
cost = (maxhealth - health?) / 10
unless mana?(cost)
respond("Insufficient mana, will continue when you have enough...")
until mana?(cost)
sleep 1
end
end
fput "cure blood"
sleep 3
waitrt?
end
end
# And yet another 'array.each' section (as you might guess from how often I use it, it's *incredibly* handy -- it's also very easy for Lich to do, so it's *extremely* fast & *extremely* efficient, as well). Now this is where we really stick to that DRY concept (again, just stands for "Don't Repeat Yourself," which is a silly way of saying 'why write the same thing over & over when you could just write it once and reuse it?'). We keep calling those 'procedure objects' we defined above over & over, and giving them the current value of 'wound'.
to_heal.each { |wound|
until translate_wound.call(wound) == stop_at or translate_wound.call(wound) == 0
healdown.call(wound)
end
}

# And now we're done, so just point out to the user "hey, you there -- I'm finished. So, g'bye"
respond "#{target} is fully healed."

mjc
03-23-2017, 04:17 AM
This is the version of ;heal I am using and I just tried it on one person and it seemed to work fine.

What exactly are you trying to have it do?


# REQUIRED: Lich v2.88+ if you use Wizard, or Lich v3.37+ if you use StormFront
# Script for empaths to heal a target, then themselves. Basically, it clones the infamous JSE script (I think it works exactly the same, anyway... I've never used JSE, have never been an empath, and wrote it by request to suit the guy who asked for it, so who knows).

# This is the level of wound you want the script to stop at... 1 would be a minor wound (rank 1). If you'd like it to go all the way to fully healed, just change the line so that the number is 0 instead of 1.
#
# Edited by Tayre. It's faster now.
#
if Char.level >= 25
stop_at = 1
else
stop_at = 0
end

# The command 'quiet_exit' just tells Lich that it shouldn't clutter your game window when the script ends by informing you it exited.
#quiet_exit

# This checks to make sure the user gave us a name of a target to act on ('script.vars' is an array of the words the user entered after the script name, and calling the 'empty?' method of an array asks if the array is empty or not).
if script.vars.empty?
respond("You didn't supply a target! You need to tell me who to heal.")
exit
end
pause_script("knewhealbot")
# This sounds a whole lot more complicated than it really is, but the following defines a 'procedure object' -- what it does is wrap up everything in the block (the 'block' is what's between the opening squiggly '{' and the closing one '}'). Once you've defined a procedure object, you can call the object and execute it at anytime, as many times as you want, by just calling the 'call' method of procedures. So basically, 'healdown = proc' means, 'make a variable called healdown, and put the following procedure object into it'. Once that's done, you can execute the procedure with the command 'healdown.call' (for anyone familiar with JSE, I *believe*, but am not positive, there's a JSE function named 'callsub' -- the name sounds like it's doing the same thing as this, which is more or less executing a subroutine; if it helps, think of this as declaring the label for 'callsub' to execute [I think JSE works that way?]).
healdown = proc { |area|
if area =~ /head|neck/
spell = 1104
if Wounds.neck > 1 then cost = 9 else cost = 4 end
elsif area =~ /hand|arm|leg/
spell = 1102
if Wounds.limbs > 1 then cost = 7 else cost = 2 end
elsif area =~ /eye|ab|chest|back/
spell = 1105
if Wounds.torso > 1 then cost = 10 else cost = 5 end
elsif area =~ /nerve/
spell = 1103
if Wounds.nerves > 1 then cost = 8 else cost = 3 end
end
unless mana?(cost)
respond("Insufficient mana, will continue when you have enough...")
until mana?(cost)
sleep 1
end
end
# fput "prep #{spell}"
fput "cure #{area}"
sleep 3
waitrt?
}

# Another procedure object that will be called later on in the script. I'm a big fan of the 'DRY' principle (Don't Repeat Yourself), so I like to write things just once and then repeat them with a single line instead of having to write them over & over again anytime I want to do the same thing.
translate_wound = proc { |wound|
wound = wound.split.join(' ')
if wound =~ /(l|r)(?:eft|ight) (arm|hand|leg|eye)/
Wounds.send("#{$1}#{$2}")
elsif wound =~ /abdom/
Wounds.send("abs")
elsif wound =~ /nerve/
Wounds.send('nerves')
elsif wound =~ /(head|neck)/
Wounds.send($1)
elsif wound =~ /(chest|back)/
Wounds.send($1)
end
}

script.vars.shift
until script.vars.empty?
# This puts the name the user entered into a variable named 'target' (script.vars is the array of words the user gave us, and [1] means word 1; 'script.vars[2]' would ask for the second word the user gave the script, and so on).
target = script.vars.shift
fput "appraise #{target}"

# Now we wait for the result of the 'appraise (person)' command by using 'waitfor', which takes as many lines to wait for as you want (there's no limit to how many). When it finds a line that contains one of the strings (a string is just text... this comment, for instance, is a 'string') you gave it, it returns the entire matching game line. So 'wound_line = waitfor' waits for a matching line, and then sticks the matching line into the 'wound_line' variable.
wound_line = waitfor("Appraise what", "You take a quick appraisal of ")
#echo wound_line

# The 'waitfor' command does it for you automatically, but if you want to test if a string has a certain snippet inside it or not (like 'hi there' contains the snippet 'there', etc.), the easiest way is to use a regular expression match -- there's a hundred useful ways to use regular expressions, but if you don't want to get complicated, you can just ignore them all (see the comments in 'spell-list.txt' in your Lich scripts directory for more info on regular expressions). In Lich, anything inbetween two '/' characters is made a regular expression, and you can match by using the '=~' operator. So that's what this next line is about... it literally means "if the line in the 'wound_line' variable contains 'Appraise what' somewhere in it" -- if you want to, you can also do the same thing by using labels and 'match' lines the way Wizard scripts do it instead of using the method seen here.
if wound_line =~ /Appraise what/
respond("Couldn't find the target! Are you sure '#{target}' is here...?")
unpause_script("knewhealbot")
exit
elsif wound_line =~ /no apparent/
respond("dum dum dum, not injured, exiting")
unpause_script("knewhealbot")
exit
end

# Here we exploit a feature of regular expressions, which is automatically setting certain variables based on a succesful regular expression match -- for instance, enclosing something in parentheses is a quick and easy way of 'slicing' out whatever is between the opening '(' and the closing ')'. Each one gets put into a matching '$1' or '$2' or however many you have (in the following, if we added a second set of characters inside parentheses, whatever was in that part of the sentence would be in '$2' for example). All this does is extract the person's full name and use that as the target, instead of the (probably abbreviated) name the user entered.
if wound_line =~ /You take a quick appraisal of (\w+)/
target = $1.dup
end

if wound_line.include?(',')
wound_array = wound_line.split(/You take a quick appraisal of|,/)
else
wound_array = wound_line.scan(/a (?:blinded|swollen|bruised) (?:left|right) eye|deep lacerations across (?:his|her) \w+|deep gashes and serious bleeding (?:on|from|across) (?:his|her) \w+|minor cuts and bruises on (?:his|her) (?:left|right) (?:hand|arm|leg)|a (?:fractured and bleeding|completely severed) (?:left|right) (?:hand|arm|leg)|moderate bleeding from (?:his|her) neck|snapped bones and serious bleeding from the neck|minor bruises on (?:his|her) neck|minor (?:bruises|lacerations) about the head|minor cuts and bruises on (?:his|her) (?:chest|back|abdominal area)|severe head trauma and bleeding from the ears|strange case of muscle twitching|case of (?:sporadic|uncontrollable) convulsions/)
end

# This creates a new, empty array and puts it into the 'wounds' variable
wounds = Array.new

# This takes the line containing all the person's wounds that we've '.split' up into an array, and for '.each' value in the array, executes the entire block (as mentioned above, a 'block' is the code inside the squiggly brackets). We have to know how to refer to each value of the array uniquely, but we want to do the same exact thing for every one -- so when we declare the opening of the block with the squiggly '{' we also declare that inside the block, we want the current value to be in the variable 'wound'. That's what '|wound|' does.
wound_array.each { |wound|
if wound =~ /(a blinded|a swollen|a bruised|deep lacerations across his|deep lacerations across her|cuts and bruises on his|cuts and bruises on her|fractured and bleeding|completely severed|deep gashes and serious bleeding on his|deep gashes and serious bleeding on her|deep gashes and serious bleeding from his|deep gashes and serious bleeding from her) (\w+)( \w+)?/
bodypart = "#{$2.dup} #{$3.dup}"
elsif wound =~ /moderate bleeding from (his|her) neck|snapped bones and serious bleeding from the neck|minor bruises on (his|her) neck/
bodypart = "neck"
elsif wound =~ /minor bruises about the head|minor lacerations about the head|severe head trauma and bleeding from the ears/
bodypart = "head"
elsif wound =~ /strange case of muscle twitching|case of sporadic convulsions|case of uncontrollable convulsions/
bodypart = "nerves"
else
# If this particular value in the array doesn't match any of the regular expressions above (again, see 'spell-list.txt' for details on regular expressions), then we don't know what wound it is and have no idea what to do with it -- so to avoid it being part of our finished wound stack (the 'wounds' array), we use the 'next' command, which skips anything else left inside a block and moves on to the next iteration (an 'iteration' is the name for each time the code inside a block is executed -- so skipping the rest of the code and moving to the next 'iteration', in this case, means just keep going and repeat the code block for the next value in the array).
next
end

# Now that we've identified which wound we're dealing with (that's what the 'if/elsif' stuff above is about), we '.push' the result on to our 'wounds' array
wounds.push(bodypart)
}


# Since the previous code block is pretty advanced compared to Wizard scripts, let me try to clarify: at this point in the script (when Lich has gotten to the line that this comment is on), the above code block has been executed for every value in the 'wound_array' variable. The 'wound_array' variable is, as the name suggests, an 'array' of values, and each value happens to be the description of a given wound ('a fractured and bleeding right leg', for instance). So for every one of those lines, the code block was executed, and each time the 'wound' variable was replaced with the current value. So if the wound_array was an array containing the strings, 'cuts and bruises on his left leg', and 'a fractured and bleeding right arm', the 'wound' variable would contain the string 'cuts and bruises on his left leg' the first time the block was executed, then the second time it was executed, the 'wound' variable would contain 'a fractured and bleeding right arm'. I hope that helps clear up what it did.

# If the 'wound_array' variable was an empty array, or if none of the strings it contained could be identified as meaning a person had a certain wound, then our 'wounds' variable will be an empty array (because the 'wounds.push(bodypart)' line from the above code block never got to be executed). This just checks to make sure there's something inside 'wounds' for us to be working on.

# This just creates yet another empty array, and sticks it into another variable (here we use 'to_heal'). If you haven't stumbled on the info yet, in Lich, you can create a variable with any name you want by doing this, and make it equal anything you want (just make sure you don't try to make a variable with the same name as a command, otherwise you're going to get cryptic-sounding errors about 'no method for =' and so forth).
to_heal = Array.new

# Now we again call '.each', but this time, we want to use the 'wounds' array. We again use the 'wound' variable for each value of the array, but we could make up any variable name we wanted -- 'thingiemajig', 'myvariable', 'you_suck', whatever name you want the variable to have, just as long as it's one word.
wounds.each { |wound|
wound = wound.split.join(' ')
if wound =~ /(l|r)(?:eft|ight) (arm|hand|leg|eye)/
to_heal.push(wound)
if Wounds.send("#{$1}#{$2}") == 3
healdown.call(wound)
end
fput "transfer #{target} #{wound}"

elsif wound =~ /abdom/
to_heal.push('abdomen')
if Wounds.send("abs") == 3
healdown.call('abdomen')
end
fput "transfer #{target} abdomen"
sleep 1
elsif wound =~ /nerve/
to_heal.push('nerves')
if Wounds.send('nerves') == 3
healdown.call('nerves')
end
fput "transfer #{target} nerves"
sleep 1
elsif wound =~ /(head|neck)/
to_heal.push($1)
if Wounds.send($1) == 3
healdown.call($1)
end
fput "transfer #{target} #{$1}"

elsif wound =~ /(chest|back)/
to_heal.push($1)
if Wounds.send($1) == 3
healdown.call($1)
end
put "transfer #{target} #{$1}"

end
}

# Now we make a new variable called 'bloodline' and put an empty 'string' in it.
bloodline = String.new

# This is the same kind of concept as 'array.each' -- except 'until' keeps repeating code over & over again, without any limit to how many times, 'until' something is true. In this case, we ask it to repeat the code until the value of 'bloodline' is a string containing 'Nothing happens' or 'all', OR the value of 'health?' is less than or equal to 75 ('health?' is a Lich command which means your current health).
until bloodline =~ /Nothing happens|all|want/
if health? <= 75 or percenthealth < 51
if mana?((maxhealth - health?) / 10)
# fput "prep 1101"
fput "cure"
sleep 3
waitrt?
next
else
respond("You have insufficient health to safely continue, and insufficient mana to heal yourself... please handle the situation manually.")
break
end
end
# if health? <= 75
# respond("You have insufficient health to safely continue, and insufficient mana to heal yourself... please handle the situation manually.")
# break
# end
fput "transfer #{target}"
bloodline = waitfor "Nothing happens", "You take some", "You take all", "want"
end

# 'percenthealth' is another Lich command, and it's just the percentage of your current health. So now we say, "until we have 100% health, keep doing this over & over".
while (health?.to_i != 0) and (health?.to_i < maxhealth.to_i)
cost = (maxhealth - health?) / 10
unless mana?(cost)
respond("Insufficient mana, will continue when you have enough...")
until mana?(cost)
sleep 1
end
end
fput "cure blood"
sleep 3
waitrt?
end
end
# And yet another 'array.each' section (as you might guess from how often I use it, it's *incredibly* handy -- it's also very easy for Lich to do, so it's *extremely* fast & *extremely* efficient, as well). Now this is where we really stick to that DRY concept (again, just stands for "Don't Repeat Yourself," which is a silly way of saying 'why write the same thing over & over when you could just write it once and reuse it?'). We keep calling those 'procedure objects' we defined above over & over, and giving them the current value of 'wound'.
to_heal.each { |wound|
until translate_wound.call(wound) == stop_at or translate_wound.call(wound) == 0
healdown.call(wound)
end
}

# And now we're done, so just point out to the user "hey, you there -- I'm finished. So, g'bye"
respond "#{target} is fully healed."


I use this with no problems. Last used this morning.

FlayedAngel
03-25-2017, 02:11 AM
It seems it might be a bigger issue than just healing scripts... the game itself seems to be lagging kinda heavily at times for me, and various things seem to want to cut in and out -- including ;go2, which may be related to the lagging, as I'm guessing scripts are getting hung up trying to execute something and then failing?

I've actually had it not be able to track any rooms before (as if the database is gone, or something), which is weird... when that happens, I usually log out and log back in again and it's corrected.

Is it some kind of connectivity issue?

Tgo01
03-25-2017, 02:13 AM
It seems it might be a bigger issue than just healing scripts... the game itself seems to be lagging kinda heavily at times for me, and various things seem to want to cut in and out (including ;go2, which may be related to the lagging).

I've actually had it not be able to track any rooms before (as if the database is gone, or something), which is weird... when that happens, I usually log out and log back in again and it's corrected.

Do you happen to run the ;title script?

FlayedAngel
03-25-2017, 02:28 AM
Do you happen to run the ;title script?
No, but that seems like a pretty cool script.

Tgo01
03-25-2017, 02:29 AM
No, but that seems like a pretty cool script.

It's the awesomest! But an earlier version caused some major lag in rooms with a lot of people so I was thinking this might be the problem.

I'm out of ideas then :(

FlayedAngel
03-25-2017, 02:30 AM
listall: --- Lich: narost, rnum, dreavening, infomon, lnet, keepalive, windowsorter, loud-exp-pulse, trollhear, inspectweight, uberbar

FlayedAngel
03-25-2017, 02:45 AM
It's the awesomest! But an earlier version caused some major lag in rooms with a lot of people so I was thinking this might be the problem.

I'm out of ideas then :(
I tried killing/not running various scripts and removing them from favorites and relogging (including ;dreavening, and some others), but no dice...

Tgo01
03-25-2017, 02:47 AM
I tried killing/not running various scripts and removing them from favorites and relogging (including ;dreavening, and some others), but no dice...

What's your total CPU and memory usage when you start lagging? Maybe you're running a program with a memory leak.

MzFit Toy
03-25-2017, 07:32 AM
Question, Crux. When you log into the game, have you ever noticed your Story window does not load correctly?

This kinda sounds like the issue I am having on Dirvy and only on Dirvy. None of my scripts would work most of the time, and when this happened, I noticed the Story window would load in my Inventory window. What that has to do with it, I have no idea. Doug thought it might be an issue with something I am wearing/carrying, etc. And while the issue isn't fixed, there is a band-aid sort of solution for this.

Drafix took a look at my account, but couldn't figure it out, but he had me disable the dialog and inventory flags before I log off. When I log back on, everything is fine, I just have to remember to turn on the dialog and inventory flags again, and turn them off before I log out, or I will end up having this issue again. It also happens on disconnects 80% of the time, because I didn't have a chance to turn off the flags.

Ltlprprincess
03-25-2017, 10:38 AM
Uberbar may be the issue. I've started noticing things "break" when I run it in my favs: Correct log in is sporadic, story window can sometimes load into my room window, ;alchemy wouldn't work for me at all. It doesn't seem to create issues except when I'm playing a capped character.

Gnomad
03-25-2017, 11:55 AM
It doesn't seem to create issues except when I'm playing a capped character.


https://www.youtube.com/watch?v=7X6CTx8DA5c

FlayedAngel
03-25-2017, 11:10 PM
Question, Crux. When you log into the game, have you ever noticed your Story window does not load correctly?

YES!

FlayedAngel
03-25-2017, 11:11 PM
Awesome, thanks all! I'll try these tips, see if it helps.

Ltlprprincess
03-25-2017, 11:11 PM
https://www.youtube.com/watch?v=7X6CTx8DA5c

I hate you sometimes.

FlayedAngel
03-25-2017, 11:18 PM
Drafix took a look at my account, but couldn't figure it out, but he had me disable the dialog and inventory flags before I log off. When I log back on, everything is fine, I just have to remember to turn on the dialog and inventory flags again, and turn them off before I log out, or I will end up having this issue again. It also happens on disconnects 80% of the time, because I didn't have a chance to turn off the flags.

I'll give that a shot, and Uberbar.

FlayedAngel
03-25-2017, 11:33 PM
Hey, I tried those things and it seems to be working! *fingers crossed*

MotleyCrew
12-16-2017, 12:27 PM
Any new healing scripts that DO NOT use lich out there? Something they did to 'fix' empaths is screwing up my script

mgoddess
12-16-2017, 02:22 PM
Any new healing scripts that DO NOT use lich out there? Something they did to 'fix' empaths is screwing up my script
I'm using a wound-transfer script that was broken with the recent empath updates (messaging, specifically), and had to go in the other day to replace the 'You meditate' that it was hooking/waiting for, with some of the new messaging.

MotleyCrew
12-16-2017, 02:33 PM
I guess I'll have to go do some healing and see what the new messaging is. I *think* I got this script here, I am not a script builder myself for anything complicated. It will heal 1 wound but then hang. This is the script I was using:

goto appraise
appraise2:
wait
appraise:
put appraise %2
match head severe head
match head lacerations about the head
match right.eye a blinded right eye
match left.eye a blinded left eye
match right.eye a swollen right eye
match left.eye a swollen left eye
match neck bleeding from the neck
match neck moderate bleeding
match chest chest
match abdomen abdominal
match nerve case
match back back
match left.hand left hand
match right.arm right arm
match left.arm left arm
match right.hand right hand
match right.leg right leg
match left.leg left leg
match right.eye right eye
match left.eye left eye
match head the head
match neck neck
match blood1 a quick
match exit what
match transfer ...wait
matchwait

left.eye:
save left.eye
counter set 1105
goto transfer

right.eye:
save right.eye
counter set 1105
goto transfer

chest:
save chest
counter set 1105
goto transfer

abdomen:
save abdomen
counter set 1105
goto transfer

back:
save back
counter set 1105
goto transfer

head:
save head
counter set 1104
goto transfer

neck:
save neck
counter set 1104
goto transfer

nerve:
save nerve
counter set 1103
goto transfer

left.leg:
save left.leg
counter set 1102
goto transfer

right.leg:
save right.leg
counter set 1102
goto transfer

left.arm:
save left.arm
counter set 1102
goto transfer

right.arm:
save right.arm
counter set 1102
goto transfer

left.hand:
save left.hand
counter set 1102
goto transfer

right.hand:
save right.hand
counter set 1102
goto transfer

transfer:
put tran %2 %s
match transfer As you probe the wound,
match heal You must heal your
match exit Transfer from whom?
match appraise2 is transferred to you.
match demeanor doesn't look like
match appraise Nothing happens.
match transfer ...wait
matchwait

healwait:
pause 2
heal:
put prep %c
match healcure Your spell is ready.
match healwait sec
match healrelease You must RELEASE
matchwait
healcure:
put cure %s
goto %s
healrelease:
put release
goto heal

demeanor:
put whisper %2 You'll have to change your demeanor to neutral or higher if you want to be healed.
pause 10
goto %s

blood1:
counter set %1
counter subtract
save %c
counter subtract
checkblood1:
put con
match fullblood Health Points Left: %1
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood2 Health Points left:
match checkblood1 Sorry, you may only type
matchwait

blood2:
counter subtract
save %c
counter subtract
checkblood2:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood3 Health Points left:
match checkblood2 Sorry, you may only type
matchwait

blood3:
counter subtract
save %c
counter subtract
checkblood3:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood4 Health Points left:
match checkblood3 Sorry, you may only type
matchwait

blood4:
counter subtract
save %c
counter subtract
checkblood4:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood5 Health Points left:
match checkblood4 Sorry, you may only type
matchwait

blood5:
counter subtract
save %c
counter subtract
checkblood5:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match restore Health Points left:
match checkblood5 Sorry, you may only type
matchwait

restorewait:
pause 2
restore:
put prep 1101
match restorecure Your spell is ready.
match restorewait sec
match restorerel You must RELEASE
restorecure:
put cure
pause 3
goto blood1
restorerel:
put release
goto restore

fullblood:
put tran %2
match restoredone You take all
match restore You take some
match exit Transfer from whom?
match exit Nothing happens.
matchwait

okay:
put tran %2
match restoredone You take all
match restore You take some
match restoredone Transfer from whom?
match restoredone Nothing happens.
matchwait

restoredonewait:
pause 2
restoredone:
put prep 1101
match restoredonecure Your spell is ready.
match restoredonewait sec
match restoredonerel You must RELEASE
matchwait
restoredonecure:
put cure
put con
match exit Health Points Left: %1
match restoredonewait Health Points Left:
matchwait
restoredonerel:
put release
goto restoredone

exit:
exit

Mercucius
12-17-2017, 12:23 AM
Give this a try. Only changed the MATCH for transferring wounds. I'm not an empath so let me know if anything goes wonky (like if it doesn't work for certain wounds):

goto appraise
appraise2:
wait
appraise:
put appraise %2
match head severe head
match head lacerations about the head
match right.eye a blinded right eye
match left.eye a blinded left eye
match right.eye a swollen right eye
match left.eye a swollen left eye
match neck bleeding from the neck
match neck moderate bleeding
match chest chest
match abdomen abdominal
match nerve case
match back back
match left.hand left hand
match right.arm right arm
match left.arm left arm
match right.hand right hand
match right.leg right leg
match left.leg left leg
match right.eye right eye
match left.eye left eye
match head the head
match neck neck
match blood1 a quick
match exit what
match transfer ...wait
matchwait

left.eye:
save left.eye
counter set 1105
goto transfer

right.eye:
save right.eye
counter set 1105
goto transfer

chest:
save chest
counter set 1105
goto transfer

abdomen:
save abdomen
counter set 1105
goto transfer

back:
save back
counter set 1105
goto transfer

head:
save head
counter set 1104
goto transfer

neck:
save neck
counter set 1104
goto transfer

nerve:
save nerve
counter set 1103
goto transfer

left.leg:
save left.leg
counter set 1102
goto transfer

right.leg:
save right.leg
counter set 1102
goto transfer

left.arm:
save left.arm
counter set 1102
goto transfer

right.arm:
save right.arm
counter set 1102
goto transfer

left.hand:
save left.hand
counter set 1102
goto transfer

right.hand:
save right.hand
counter set 1102
goto transfer

transfer:
put tran %2 %s
match transfer As you probe the wound,
match heal You must heal your
match exit Transfer from whom?
match appraise2 forming on you
match demeanor doesn't look like
match appraise Nothing happens.
match transfer ...wait
matchwait

healwait:
pause 2
heal:
put prep %c
match healcure Your spell is ready.
match healwait sec
match healrelease You must RELEASE
matchwait
healcure:
put cure %s
goto %s
healrelease:
put release
goto heal

demeanor:
put whisper %2 You'll have to change your demeanor to neutral or higher if you want to be healed.
pause 10
goto %s

blood1:
counter set %1
counter subtract
save %c
counter subtract
checkblood1:
put con
match fullblood Health Points Left: %1
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood2 Health Points left:
match checkblood1 Sorry, you may only type
matchwait

blood2:
counter subtract
save %c
counter subtract
checkblood2:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood3 Health Points left:
match checkblood2 Sorry, you may only type
matchwait

blood3:
counter subtract
save %c
counter subtract
checkblood3:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood4 Health Points left:
match checkblood3 Sorry, you may only type
matchwait

blood4:
counter subtract
save %c
counter subtract
checkblood4:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match blood5 Health Points left:
match checkblood4 Sorry, you may only type
matchwait

blood5:
counter subtract
save %c
counter subtract
checkblood5:
put con
match okay Health Points Left: %s
match okay Health Points Left: %c
match restore Health Points left:
match checkblood5 Sorry, you may only type
matchwait

restorewait:
pause 2
restore:
put prep 1101
match restorecure Your spell is ready.
match restorewait sec
match restorerel You must RELEASE
restorecure:
put cure
pause 3
goto blood1
restorerel:
put release
goto restore

fullblood:
put tran %2
match restoredone You take all
match restore You take some
match exit Transfer from whom?
match exit Nothing happens.
matchwait

okay:
put tran %2
match restoredone You take all
match restore You take some
match restoredone Transfer from whom?
match restoredone Nothing happens.
matchwait

restoredonewait:
pause 2
restoredone:
put prep 1101
match restoredonecure Your spell is ready.
match restoredonewait sec
match restoredonerel You must RELEASE
matchwait
restoredonecure:
put cure
put con
match exit Health Points Left: %1
match restoredonewait Health Points Left:
matchwait
restoredonerel:
put release
goto restoredone

exit:
exit

MotleyCrew
12-17-2017, 02:35 PM
We figured it out but, I will try this some time and let you know. Thank you!