PDA

View Full Version : Assistance with a downstream hook (Dragonrealms)



i play dr
06-19-2011, 04:19 AM
Here's hoping this makes sense!

Veni on Lnet was really awesome in helping me set this up; however, now that I have the hook in, and am running the script, I notice that there doesn't seem to be a wait time for my Roundtime to put in.

Basically it normally works like this:

You reach out with your senses and hear glowing streams of harmonious Elemental mana coursing through the area.
Concentrating harder on the sounds you hear, you can sense luminous mana to the west, and radiant mana to the southeast.
You sense the Merelew's Legacy enchante upon you, which should last until the song ends or transitions to a new part.
Roundtime: 3 sec.

Then after the roundtime is up, my script keeps chugging along (stormfront scripts, not a lich script)

When I add the lich script to change the current room mana output to numbers like this:

Your Room Mana: 7/21

Concentrating harder on the sounds you hear, you can sense luminous mana to the west, and radiant mana to the southeast.
You sense the Merelew's Legacy enchante upon you, which should last until the song ends or transitions to a new part.
Roundtime: 3 sec.

it ends up not being able to wait, and I see:

Your Room Mana: 7/21
Concentrating harder on the sounds you hear, you can sense luminous mana to the west, and radiant mana to the southeast.
You sense the Merelew's Legacy enchante upon you, which should last until the song ends or transitions to a new part.
Roundtime: 3 sec.
R>climb prac wall
...wait 3 seconds.
R>climb prac wall
...wait 2 seconds.
R>climb prac wall
...wait 2 seconds.
R>climb prac wall
...wait 2 seconds.
R>climb prac wall
...wait 1 seconds.
R>climb prac wall
...wait 1 seconds.
R>climb prac wall
You begin to practice your climbing skills.


The lich script looks similar to this:
if server_string =~ /(.*?) faint streams (.*?)\./
server_string = "Your Room Mana: 1/21 \r \n"

with 21 different settings. Is there a different command I need to add to respect the roundtime?

Hazado
06-19-2011, 11:43 AM
Well the server string sent the roundtime code, and you replaced the server string. So the roundtime doesn't show up. Need to figure out what the code is for roundtime and keep it in there.

if server_string =~ /(.*?) faint streams (.*?)\./
echo server_string
server_string = "Your Room Mana: 1/21 \r \n"

That should tell you what the roundtime code is, so you just need to rework your regex and keep it in there.

i play dr
06-19-2011, 02:23 PM
Well the server string sent the roundtime code, and you replaced the server string. So the roundtime doesn't show up. Need to figure out what the code is for roundtime and keep it in there.

if server_string =~ /(.*?) faint streams (.*?)\./
echo server_string
server_string = "Your Room Mana: 1/21 \r \n"

That should tell you what the roundtime code is, so you just need to rework your regex and keep it in there.


Thanks, I'll try that!

i play dr
06-26-2011, 08:04 AM
ok!

I finally got around to trying this.

This is what I get back

[(unknown script): <roundTime value='1309089813'/>You reach out with your senses and hear luminous streams of harmonious Elemental mana coursing through the area.]

So, I see that is my value. Where do I place it in the script? Sorry, I am really dumb with this stuff.

Hazado
06-26-2011, 11:15 AM
if server_string =~ /(<roundTime value='.*'\/>).*?faint streams.*?\./
server_string = "$1Your Room Mana: 1/21 \r \n"

i play dr
06-26-2011, 09:22 PM
if server_string =~ /(<roundTime value='.*'\/>).*?faint streams.*?\./
server_string = "$1Your Room Mana: 1/21 \r \n"


Added this, but I'm still getting having the same issue. :\


if server_string =~ /(<roundTime value='.*'\/>).*?faint streams (.*?)\./
server_string = "Your Room Mana: 1/21 \r \n"

right?

oh wait, see something i missed. fixed it and it's still doing it.

Hazado
06-26-2011, 10:04 PM
Hmm, try that

if server_string =~ /(<roundTime value=\'.*\'\/>).*?faint streams.*?\./
server_string = "#{$1}Your Room Mana: 1/21 \r \n"

i play dr
06-26-2011, 10:15 PM
Hmm, try that

if server_string =~ /(<roundTime value=\'.*\'\/>).*?faint streams.*?\./
server_string = "#{$1}Your Room Mana: 1/21 \r \n"


You're awesome. Thanks for the help.

Taghz
07-10-2011, 07:55 PM
Working with this resolution.. How would I modify the following but only substitute a specific word or two?


You reach out with your senses and see radiant streams of golden Holy mana radiating through the area.
Letting your senses extend further, you feel there is flickering mana to the west, and flickering mana to the east.
You sense the Heroic Strength spell upon you, which should last for about ten roisaen.
You have not exhausted your ability to smite your foes at all.
Roundtime: 3 sec.




if server_string =~ /(<roundTime value=\'.*\'\/>).*?radiant streams.*?\./
server_string = "#{$1}You reach out with your senses and see radiant streams (15/21) of golden Holy mana radiating through the area. \r \n" //output string


You reach out with your senses and see radiant streams (15/21) of golden Holy mana radiating through the area.
Letting your senses extend further, you feel there is flickering mana to the west, and flickering mana to the east.
You sense the Heroic Strength spell upon you, which should last for about eleven roisaen.
You are preparing the Heroic Strength spell at twenty-two mana.
You have not exhausted your ability to smite your foes at all.
Roundtime: 3 sec.

Is there a way to just substitute the one or two word string in a specific output sentence?

My goal is to sub out a ton of different specific small strings to look similar above in a one or multiple scripts. This resolve will also help

ie:

to make the following
somewhat fair puncture damage
very severe slice damage
moderate impact damage

look like

somewhat fair puncture damage (x/25)
very severe slice damage (x/25)
moderate impact damage (x/25)

Thanks for the help...

Hazado
07-10-2011, 08:08 PM
Well basically you would put () around whatever you wanted to save, then in the output use $# (ie. $1 for first (), $2 for second (), and so on) with the stuff you wanted to add between the $#


if server_string =~ /(.*somewhat fair puncture damage)(.*)/
server_string = "#{$1}\(x\/25\)#($2)" //output string
end

If you haven't used regex before look over this website http://www.regular-expressions.info/