PDA

View Full Version : Help for a scripting newb



MxPx1483
07-20-2005, 10:49 PM
Alright, trying out my first script to hunt wind wraiths in Teras...but its really buggy (not quite finished either). It would be greatly appreciated if some of you experienced scripters could point out any of the obvious mistakes you see and maybe throw in a few pointers. thanks:

start:
put stand
wait 9
put Take my buckler from my harness
match You stand back up
matchwait

move w
move w
move w
move w
move n
move n
move go gate
move n
move n
move nw
move go road
move e
move e
move go bri
move e
move e
move e
move e
move e
move go trail

put Sign of smiting
put sign of striking
pause 2
put sign of warding
put sign of defending
pause 2
put sign of deflection
pause 2
put sign of dissipation
pause 2
put sign of swords
pause 2
put sign of shields
pause 2

put jump
pause 3

enterstand:
put grovel
match enterstunned stunned
match stand grovel
match enterpause wait
match stand You are no longer stunned.
matchwait

enterstunned:
pause 4
goto enterstand

stand:
put stand
pause 2
goto hunt

enterpause:
pause 2
goto enterstand

hunt:
pause 1
put look
match filter wind wraith
match filter wind wraith
match filter wind wraith
match continuehunt [Golvern and Dragonstail]
match logoff [Scripting Violation Limbo]
match logoff [Consultation Lounge]
match logoff [The Cell]
match lost Obvious paths:
match lost Obvious exits:
matchwait

lost:
pause .5
match R1 The tunnel flares out into a wide
match R2 While the rampaging wind and
match R3 A thin divider of smooth volcanic
match R4 The tunnel widens and narrows as it
match R5 The wind speaks with a passionate voice
match R6 The tunnel stretches away in either direction
match R7 A single crack mars the side of the tunnel here
match R8 The wind is cold, and not the sort
match R9 In the roof of the tunnel is a dark hollow
match R10 Cold glassy walls close in on either
match R11 The tunnel seems oddly warm here despite
match R12 Westward, a pale red circle gleams
match R12 Howling wind bursts out into a vast cavern

R1:
pause .5
put w
counter set 2
goto checkroom

R2:
pause .5
put w
counter set 3
goto checkroom

R3:
pause .5
put w
counter set 4
goto checkroom

R4:
pause .5
put w
counter set 5
goto checkroom

R5:
pause .5
put w
counter set 6
goto checkroom

R6:
pause .5
put w
counter set 7
goto checkroom

R7:
pause .5
put w
counter set 8
goto checkroom

R8:
pause .5
put w
counter set 9
goto checkroom

R9:
pause .5
put w
counter set 10
goto checkroom

R10:
pause .5
put w
counter set 11
goto checkroom

R11:
pause .5
put w
counter set 12
goto checkroom

R12:
pause .5
put e
counter set 13
goto checkroom


checkroom:

match start Sorry, you may only type ahead
match R%c You can't go there
match R%c I could not find what
match filter wind wraith
match R%c Obvious paths:
match R%c Obvious exits:
matchwait

filter:
put look
match start You can't go there.
match R%c Also here:
match attack Obvious paths:
match attack Obvious exits:
matchwait

attack:
Put stance offensive
pause .5
Put incant 306
pause 3
match dead The wraith releases a groan of
match attack A wind wraith claws at you!
match attack A turbulent wind surrounds
match attack A wind wraith just arrived
match attack Roundtime:
match attack Wait
match attack ...wait
match attack only type ahead
match attack Please wait
match R%c I could not find
match R%c What were you referring to?
matchwait

dead:
put exp
match moverest Your mind is numbed.
match moverest Your mind can't take much more of this!
match R12 Your Mind
goto checkmana
matchwait


checkmana:
put mana
match moverest Remaining: 0
match moverest Remaining: 1
match moverest Remaining: 2
match moverest Remaining: 3
match moverest Remaining: 4
match moverest Remaining: 5
match moverest Remaining: 6
match moverest Remaining: 7
match moverest Remaining: 8
match moverest Remaining: 9
match moverest Remaining: 10
match moverest Remaining: 11
match moverest Remaining: 12
match moverest Remaining: 13
match moverest Remaining: 14
match moverest Remaining: 15
match moverest Remaining: 16
match moverest Remaining: 17
match moverest Remaining: 18
match moverest Remaining: 19
match moverest Remaining: 20
match moverest Remaining: 21
match moverest Remaining: 22


moverest:
move w
move w
match niche You can't go there
matchwait

niche:
put go niche
put remove gold ring
put wear gold ring
put put my buckler in my harness
incant 213
put meditate
waitfor You begin to
Pause 150
Pause 150
Pause 150
goto spellup
Pause 150
Pause 150
goto start

Bobmuhthol
07-20-2005, 10:59 PM
<<start:
put stand
wait 9>>

I think you mean pause 9. In any event, what's the point? A pause will wait until your roundtime is over.

<<put Take my buckler from my harness
match You stand back up
matchwait>>

I don't even know what this is. You stand, pause for 9 seconds, take out your shield, then do a match for "stand back up" and don't have a You label (hint: the syntax is MATCH %LABEL% $STRING$). What you want to have is..

Start:
put stand
waitfor You stand back up.
pause (optional but will probably help prevent hanging)
put Take my buckler from my harness

<<put Sign of smiting
put sign of striking
pause 2
put sign of warding
put sign of defending
pause 2
put sign of deflection
pause 2
put sign of dissipation
pause 2
put sign of swords
pause 2
put sign of shields
pause 2

put jump
pause 3>>

Should really be

put Sign of smiting
waitfor You
put sign of striking
waitfor You
put sign of warding
waitfor You
put sign of defending
waitfor You
put sign of deflection
waitfor You
put sign of dissipation
waitfor You
put sign of swords
waitfor You
put sign of shields
waitfor You

put jump
pause 3

For efficiency.

I don't even want to begin looking at the rest.

Jorddyn
07-20-2005, 11:24 PM
Skipping what Bob already mentioned...

I don't think the mana check will work because your "moverest" matches will catch every possible mana amount - "Remaining: 1" will match not only 1, but everything starting with a 1 - 10, 11, 12, 100, 101, 129, etc. I think the typical script uses a channel <#> <self> syntax, matching either the "You don't have enough mana" or "Channeling to yourself?" messages (not exact).

You have a "Goto spellup" without any "Spellup" tag.

You don't have a failure message for standing (it does happen sometimes, even if unencumbered).

I'm not sure what this ...

match filter wind wraith
match filter wind wraith
match filter wind wraith ...

accomplishes. Shouldn't once be sufficient?

I don't see where your "Checkroom" actually LOOKs, which might cause it to hang.

The "Match Start" under "Checkroom" really should just go back to "Checkroom", not the beginning.

I know nothing about spellcasting, but unless 306 vaporizes wraiths entirely, you should have a loot or search command, or you'll keep attacking the dead ones.

You don't have a failsafe for your ring getting navved.

Fix all of that, and let us know specifically where the remaining issues are (the script hangs when X, the script does the wrong thing when Y).

Jorddyn

Bobmuhthol
07-20-2005, 11:29 PM
<hilariously mean>

To fix the goto spellup without a spellup label, you can add this at the end of the script:

LabelError:
put report FUCK YOU GAYMASTER.
goto Start

</hilariously mean>

MxPx1483
07-21-2005, 12:00 AM
Alright, thanks for your help so far...below is the revised version(wraiths disappear instantly, so there is no need to search them). Here's a few of my concerns that I can think of already:
1. If I am unstunned/pulled up by someone after falling, will the script still run?
2. I'm pretty sure I'm going to get trapped on the western end of the hunting ground, how can I avoid that.
3. The hunting area occasionally has wind gusts that knock me on the ground and dispell my air wall, how can I avoid that?

#Wraiths

start:
put stand
waitfor You stand back up.
pause 1
put Take my buckler from my harness

move w
move w
move w
move w
move n
move n
move go gate
move n
move n
move nw
move go road
move e
move e
move go bri
move e
move e
move e
move e
move e
move go trail

put Sign of smiting
waitfor You
put sign of striking
waitfor You
put sign of warding
waitfor Your
put sign of defending
waitfor Your
put sign of deflection
waitfor You
put sign of dissipation
waitfor Magic
put sign of swords
waitfor You
put sign of shields
waitfor Your

put jump
pause 3

enterstand:
put grovel
match enterstunned stunned
match stand grovel
match enterpause wait
match stand You are no longer stunned.
matchwait

enterstunned:
pause 4
goto enterstand

stand:
put stand
pause 2
goto hunt

enterpause:
pause 2
goto enterstand

hunt:
pause 1
put look
match filter wind wraith
match continuehunt [Golvern and Dragonstail]
match logoff [Scripting Violation Limbo]
match logoff [Consultation Lounge]
match logoff [The Cell]
match lost Obvious paths:
match lost Obvious exits:
matchwait

lost:
pause .5
match R1 The tunnel flares out into a wide
match R2 While the rampaging wind and
match R3 A thin divider of smooth volcanic
match R4 The tunnel widens and narrows as it
match R5 The wind speaks with a passionate voice
match R6 The tunnel stretches away in either direction
match R7 A single crack mars the side of the tunnel here
match R8 The wind is cold, and not the sort
match R9 In the roof of the tunnel is a dark hollow
match R10 Cold glassy walls close in on either
match R11 The tunnel seems oddly warm here despite
match R12 Westward, a pale red circle gleams
match R12 Howling wind bursts out into a vast cavern

R1:
pause .5
put w
counter set 2
goto checkroom

R2:
pause .5
put w
counter set 3
goto checkroom

R3:
pause .5
put w
counter set 4
goto checkroom

R4:
pause .5
put w
counter set 5
goto checkroom

R5:
pause .5
put w
counter set 6
goto checkroom

R6:
pause .5
put w
counter set 7
goto checkroom

R7:
pause .5
put w
counter set 8
goto checkroom

R8:
pause .5
put w
counter set 9
goto checkroom

R9:
pause .5
put w
counter set 10
goto checkroom

R10:
pause .5
put w
counter set 11
goto checkroom

R11:
pause .5
put w
counter set 12
goto checkroom

R12:
pause .5
put e
counter set 13
goto checkroom


checkroom:
match checkroom Sorry, you may only type ahead
match R%c You can't go there
match R%c I could not find what
match filter wind wraith
match R%c Obvious paths:
match R%c Obvious exits:
matchwait

filter:
put look
match start You can't go there.
match R%c Also here:
match attack Obvious paths:
match attack Obvious exits:
matchwait

attack:
Put stance offensive
pause .5
Put incant 306
pause 3
match dead The wraith releases a groan of
match attack A wind wraith claws at you!
match attack A turbulent wind surrounds
match attack A wind wraith just arrived
match attack Roundtime:
match attack Wait
match attack ...wait
match attack only type ahead
match attack Please wait
match R%c I could not find
match R%c What were you referring to?
matchwait

dead:
put exp
match moverest Your mind is numbed.
match moverest Your mind can't take much more of this!
match R12 Your Mind
goto checkmana
matchwait


checkmana:
manacheck:
channel 24
match moverest You don't have
match checkroom Channeling to
matchwait


moverest:
move w
move w
match niche You can't go there
matchwait

niche:
put go niche
put remove gold ring
put wear gold ring
put put my buckler in my harness
incant 213
put meditate
waitfor You begin to
Pause 150
Pause 150
Pause 150
goto spellup
Pause 150
Pause 150
goto start

spellup:
To be continued...

MxPx1483
07-21-2005, 12:13 AM
<<3. The hunting area occasionally has wind gusts that knock me on the ground and dispell my air wall, how can I avoid that? >>

Sorry, meant to say how can I script it so I recover from that?

Artha
07-21-2005, 12:19 AM
Each time you move, add a match to see if you're already knocked down, should be something like this.

KnockedDownLoop:
put 102
waitfor You
put stand
waitfor You
goto R%c%


Also, I could be mistaken, but I don't believe pause .5 works. It doesn't understand the .5 and just does a straight pause, which lasts a little longer than one second. The real way to go here is with waitfors, so that lag won't fuck you up.

MxPx1483
07-24-2005, 05:02 PM
Okay, still having some trouble here after I kill the wraiths. The script doesn't change rooms like I want it too, just keeps me in the same room and doesnt act until another wraith comes in....Heres the part that I want it to execute.

attack:
Put stance offensive
pause .5
Put incant 306
match dead groan of mingled
pause 3
match attack A wind wraith claws at you!
match attack A turbulent wind surrounds
match attack A wind wraith just arrived
match attack Roundtime:
match attack Wait
match attack ...wait
match attack only type ahead
match attack Please wait
match knockdown The air calms down
match R%c I could not find
match R%c What were you referring to?
matchwait

dead:
put experience
match moverest Your mind can't take much more of this!
goto checkmana Your Mind is
matchwait


checkmana:
send 30
match moverest You don't have
match checkroom Channeling to
matchwait


What am I doing wrong now?

MxPx1483
07-24-2005, 05:05 PM
Oh, and I guess I should add that the wraiths' death messaging is:

The wraith releases a groan of mingled...blah blah blah

Its the same message for every death.

Jorddyn
07-24-2005, 05:29 PM
Originally posted by MxPx1483
The script doesn't change rooms like I want it too, just keeps me in the same room and doesnt act until another wraith comes in....Heres the part that I want it to execute.

attack:
Put stance offensive
pause .5
Put incant 306
match dead groan of mingled
pause 3
match attack A wind wraith claws at you!
...
matchwait

What am I doing wrong now?

Try getting rid of the "pause 3". My guess is that it matches the death message, then moves on to the next string of matches, which has the "matchwait", so it waits.

Jorddyn

MxPx1483
07-26-2005, 08:37 PM
Okay now, problem number 350:
After my script determines that my guy is either fried or too low on mana, it won't head home. It will leave the room he is presently in (even if there are wraiths). But then it will go right back to checking the rooms. How can I change that?