Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Scouts
Newbie


Joined: 17 Mar 2003
Posts: 5
Location: USA

PostPosted: 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
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: 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)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Scouts
Newbie


Joined: 17 Mar 2003
Posts: 5
Location: USA

PostPosted: 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.
Reply with quote
Scouts
Newbie


Joined: 17 Mar 2003
Posts: 5
Location: USA

PostPosted: 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"
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net