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
Reapage
Newbie


Joined: 14 Nov 2001
Posts: 4
Location: Finland

PostPosted: Fri Jun 14, 2002 1:56 pm   

Trigger problem..
 
I've trying to do a trigger that whenever i look in my bag ('bag' command) it searches for how many bloody heads i have in my bags, then stores it to a variable called 'heads'.
The trigger has to check from the mud 2 lines:

When you look inside, you see:
...
[x24] a bloody head
...

the problem is i dont know how to make a trigger pattern that checks for those two lines at once..

Reapage
Reply with quote
int 21h
Newbie


Joined: 14 Jun 2002
Posts: 8

PostPosted: Fri Jun 14, 2002 8:48 pm   
 
#trigger {^When you look inside, you see:} {#t+ headcase}
#trigger {^[x(%d)] a bloody head} {#var heads %1;#t- headcase} {headcase}


In cases like this, its easiest just to use some sort of indication trigger that tells you to start looking for your pattern. Then its simply a task of seperating your triggers by class. Learn how to enable/disable classes and effectively use them with triggers and you go a long way.

---
I can show you the door, but only you can open it.

ArcticMUD (http://mud.arctic.org || telnet://mud.arctic.org:2700)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jun 14, 2002 11:55 pm   
 
[ and ] are special characters, which are used in patterns for creating range wildcards. Since that's not what you want to do (you want to match them), you need to put a ~ in front of them.
#trigger {^~[x(%d)~] a bloody head} {#var heads %1;#t- headcase} {headcase}

LightBulb
Senior Member
Reply with quote
int 21h
Newbie


Joined: 14 Jun 2002
Posts: 8

PostPosted: Sat Jun 15, 2002 12:11 am   
 
Oop, knew I forgot something

---
I can show you the door, but only you can open it.

ArcticMUD (http://mud.arctic.org || telnet://mud.arctic.org:2700)
Reply with quote
Pagan
Beginner


Joined: 23 Feb 2001
Posts: 21
Location: South Africa

PostPosted: Sun Jun 16, 2002 1:28 am   
 
ok, the above seems sound, but...
what if there are a few whitespaces between the prompt and the line saying
'inside you see:'

example:

A seemingly small bag, made out of human skin. Runes adorn the entire
surface of the bag. Yet inside the bag it seems the blackness extends
forever.
There is something in it.
--------Bag contains:
electrum ring
golden ring
jeweled egg
jeweled egg
golden ring
golden ring
golden ring
golden ring

any ideas?

(the dashes by "Bag contains:" are whitespaces x8)

Pagan
Chaos, Panic, Disorder, my work here is done.
Reply with quote
Reapage
Newbie


Joined: 14 Nov 2001
Posts: 4
Location: Finland

PostPosted: Sun Jun 16, 2002 5:30 pm   
 
Tnx :) it worked.

Just found another problem .. also dealing with the bloody heads in bag.

Now when i look in my bag and have the amount of the heads in a variable (heads), the purpose of the variable was to repeat the 'sac' (sacrifice, a mud alias that get a head from bag then sacs it on the altar) command the @heads amount of times when at altar. This helps a lot when can only press a button or type an alias to sac all heads in bag than typing 'sac' to the mud @heads times yourself, especially when you got like 250 heads in bag.
Now the problem is, that if you make an alias that repeats the sac command like 250 times to the mud rapidly, the mud disconnects you due to flooding. So the sac'ing has to paused in intervals for the mud to process the previous commands without flooding the mud.
Would work if the alias repeated sac 15 times then had a #wa 2000 or something then repeated until all heads sacrificed (The flame wells up and consumes your sacrifice! is the string from mud indicating a head being successfully sacrificed, also 'No such thing here' can be used to stop the alias from looping, (no more heads on bag to sac)

Reapage
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