|
Scouts Newbie
Joined: 17 Mar 2003 Posts: 5 Location: USA
|
Posted: Wed Mar 19, 2003 12:26 am
Script Assistance |
Looking to reverse engineer a script to help me convert my gemstone scripts to zMUD. I would greatly appreciate if someone could write a script that would:
a. “LOOK” is a room
b. Identify a creature. (@critter)
c. “KILL” the creature
d. Waits a specified “Round Time: {x}”
e. If the critter is not "already dead" then attempt to “KILL” the critter again
f. If the citter is dead then "SKIN" critter
Any help would be greatly appreciated, Thanks!
Scouts |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Wed Mar 19, 2003 8:37 am |
#TR {^(*) waits here to be killed.} {kill %word("%1",%numwords(%1)); #ALARM relook +10 {look}}
#TR {^(*) is DEAD!} {#T- relook; skin %word("%1",%numwords(%1))}
Upon looking and seeing the following:
A large brown bear waits here to be killed.
'kill bear' is sent and an Alarm named 'relook' is created to look again in ten seconds. If the bear is still waiting to be killed then 'kill bear' is sent again and a new Alarm trigger is generated.
When the bear is finally slain as indicated by:
A large brown bear is DEAD!
Then the relook alarm is turned off and the bear is skinned.
Of course, your MUD probably has different messages for mobs standing around and for mobs dying. Additionally I assumed that the keyword for a mob would be the last word in its short description. And I made the round time in the Alarm an arbitrary 10 seconds.
Troubadour
(Win 98, Pentium III, 550 MHz) |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Mar 19, 2003 4:38 pm |
Numerous GS3 scripts are available in the Finished Scripts forum. Several people made a considerable effort in this regard immediately after the Simutronics support was added, so go back about 60-90 days. You're likely to find that what you want has already been done.
It's impossible for us to "reverse engineer" your script, since you didn't provide it.
LightBulb
Advanced Member |
|
|
|
Scouts Newbie
Joined: 17 Mar 2003 Posts: 5 Location: USA
|
Posted: Thu Mar 20, 2003 1:16 am |
I was actually asking someone to write a sample script for me so that I could reverse engineer. Troubadour's example was helpful and I've also been following your suggestion and scanning scripts on the boards. Thank you both.
|
|
|
|
Scouts Newbie
Joined: 17 Mar 2003 Posts: 5 Location: USA
|
Posted: Thu Mar 20, 2003 4:57 pm |
I'm getting there...slowly
Heres a trigger I created to attack a creature in game:
#TRIGGER {(%w)} {#VAR currentt {%1};stance off}
#COND {You are now in an offensive stance} {kill @currentt}
#COND {Roundtime: (%d) sec} {#ALARM +%1 {attack}}
Questions:
Can I loop back to the first cond (state)? The text that would trigger an exit from the loop would be "is already dead" |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Mar 21, 2003 8:47 am |
Give your trigger an id then set its #STATE manually.
quote:
STATE
Syntax: #STATE [id] [state]
Related: #TRIGGER
Sets the current state of a trigger. Causes state value to be set to false so that the trigger waits for the state to be matched. If the state number is omitted, the trigger is reset and set to its initial state. Note states are numbered starting at zero.
#TRIGGER attacktrig {(%w)} {#VAR currentt {%1};stance off;#TEMP {is already dead} {#STATE attacktrig 0}}
#COND attacktrig {You are now in an offensive stance} {kill @currentt}
#COND attacktrig {Roundtime: (%d) sec} {#ALARM +%1 {attack}}
Ton Diening |
|
|
|
|
|