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
Tragedy.in.progress
Newbie


Joined: 15 Dec 2004
Posts: 8

PostPosted: Thu Dec 01, 2005 10:52 pm   

Ignore a certain name from a request
 
Before I ask, I would like to say, I did a search, and I found some threads for ignoring certain text, but I'm pretty much a newbie to zmud triggers and I didn't really understand any of what was being said. That being said.. I THINK my request is simple, I just want to ignore certain names from a request like..

Bob wants to open a trade session with you.

I want to ignore the name Bob, for lots of reasons, mainly if someone is not being very nice with their trade requests.

Thanks in advance for any help.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Dec 01, 2005 11:12 pm   
 
Two ideas come to head. One where you manually trust people for the trigger, the other where you keep track of those you do not wish the trigger to happen for.

1) Manually trusting people
#TRIGGER {^({@GoodList}) wants to open a trade session with you.} {#NOOP Do something here like auto open a trade session.}
#ALIAS addGoodList {#ADDITEM GoodList %upper("%-1");#VAR GoodList %replace(@GoodList,"||","|");#SH GoodList now: @GoodList}
#ALIAS delGoodList {#DELITEM GoodList %upper("%-1");#VAR GoodList %replace(@GoodList,"||","|");#SH GoodList now: @GoodList}

Usage:
addgoodlist Mary
delgoodlist Bob

2) Automatically trust people and keep track of a bad list.
#TRIGGER {^(%w) wants to open a trade session with you.} {#IF (%ismember(%upper(%1),@BadList) == 0) {#NOOP Do something here like auto open a trade session.} {#NOOP %1 on BadList: @BadList}}
#ALIAS addBadList {#ADDITEM BadList %upper("%-1");#VAR BadList %replace(@BadList,"||","|");#SH BadList now: @BadList}
#ALIAS delBadList {#DELITEM BadList %upper("%-1");#VAR BadList %replace(@BadList,"||","|");#SH BadList now: @BadList}

Usage:
addbadlist bob
delbadlist Mary
Reply with quote
Tragedy.in.progress
Newbie


Joined: 15 Dec 2004
Posts: 8

PostPosted: Thu Dec 01, 2005 11:35 pm   
 
I suppose I should have said I wanted to manually be able to ignore them, anyways, thanks, I'll try this.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Dec 02, 2005 12:09 am   
 
Manually being able to ignore them would be 2)
Reply with quote
Tragedy.in.progress
Newbie


Joined: 15 Dec 2004
Posts: 8

PostPosted: Fri Dec 02, 2005 12:11 am   
 
Okay, a few questions concering this part:

Quote:
#TRIGGER {^({@GoodList}) wants to open a trade session with you.} {#NOOP Do something here like auto open a trade session.}
#ALIAS addGoodList {#ADDITEM GoodList %upper("%-1");#VAR GoodList %replace(@GoodList,"||","|");#SH GoodList now: @GoodList}
#ALIAS delGoodList {#DELITEM GoodList %upper("%-1");#VAR GoodList %replace(@GoodList,"||","|");#SH GoodList now: @GoodList}


As I said I'm a total newb when it comes to triggers, so I was wondering how I would go about making it execute multiple commands like, I would want it to do something like this:

trade %1
show %1

That's obviously after the I've decided the person is okay to trade with.. err.. not added to the badlist.. I think that makes sense? It's probably obvious and simple I know, but I gotta learn somehow.

Thanks again
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Dec 02, 2005 12:28 am   
 
From 2)
#TRIGGER {^(%w) wants to open a trade session with you.} {#IF (%ismember(%upper(%1),@BadList) == 0) {trade %1;show %1} {#NOOP %1 on BadList: @BadList}}

This will auto trade/show everyone that is not on your bad list.

It checks to see if the person is not a member of the bad list then executes your automatic trade/show.
#NOOP does nothing and acts as a comment.
Reply with quote
Tragedy.in.progress
Newbie


Joined: 15 Dec 2004
Posts: 8

PostPosted: Fri Dec 02, 2005 3:15 am   
 
Well, it's working in part.. I don't know if I have them set up properly or what. It's just still letting the people trade that I have added to the badlist. How was I supposed to use these triggers, were 1 and 2 supposed to be used together or what? Because I've tried several different things that I could think of and I can make it either not trade with anyone at all, or trade with everyone, the way it is currently. And it does not matter if I add them to the goodlist or badlist using the alias's.

This is what the triggers look like in the zmud settings:

1)
^({@GoodList}) wants to open a trade session with you.
#NOOP
trade %1
show %1

2)
^(%w) wants to open a trade session with you.
#IF (%ismember( %upper( %1), @BadList) == 0) {
trade %1
show %1
} {#NOOP %1 on BadList: @BadList}

Thanks again, I really appreciate the help
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Fri Dec 02, 2005 4:46 am   
 
Not to be nosy, but you said you want to manually ignore. So, delete trigger 1 and only use trigger 2. See Ton's original code (modified):

Quote:
2) Automatically trust people and keep track of a bad list.
#TRIGGER {^(%w) wants to open a trade session with you.} {#IF (%ismember(%upper(%1),@BadList) == 0) {trade %1;show %1} {#ECHO No trade. %1 on BadList.}}
#ALIAS addBadList {#ADDITEM BadList %upper("%-1");#VAR BadList %replace(@BadList,"||","|");#SH BadList now: @BadList}
#ALIAS delBadList {#DELITEM BadList %upper("%-1");#VAR BadList %replace(@BadList,"||","|");#SH BadList now: @BadList}


Check your BadList variable (#ECHO @BadList) and make sure each entry is in ALLCAPS. Any that aren't will not match your trigger and need to be deleted via "#DELI BadList name" and reentered via your addBadList alias. (replace "name" with the actual name you want to delete)

Q: Do any of the names have numbers or symbols in them, like "Bob13" or "Bob_IsBad"?
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
Tragedy.in.progress
Newbie


Joined: 15 Dec 2004
Posts: 8

PostPosted: Fri Dec 02, 2005 11:49 am   
 
Slaem wrote:
Not to be nosy, but you said you want to manually ignore. So, delete trigger 1 and only use trigger 2. See Ton's original code (modified):

Quote:
2) Automatically trust people and keep track of a bad list.
#TRIGGER {^(%w) wants to open a trade session with you.} {#IF (%ismember(%upper(%1),@BadList) == 0) {trade %1;show %1} {#ECHO No trade. %1 on BadList.}}
#ALIAS addBadList {#ADDITEM BadList %upper("%-1");#VAR BadList %replace(@BadList,"||","|");#SH BadList now: @BadList}
#ALIAS delBadList {#DELITEM BadList %upper("%-1");#VAR BadList %replace(@BadList,"||","|");#SH BadList now: @BadList}


Check your BadList variable (#ECHO @BadList) and make sure each entry is in ALLCAPS. Any that aren't will not match your trigger and need to be deleted via "#DELI BadList name" and reentered via your addBadList alias. (replace "name" with the actual name you want to delete)

Q: Do any of the names have numbers or symbols in them, like "Bob13" or "Bob_IsBad"?


Nope, just regular one word names with no extra weird characters in them. And as for the rest, it is still behaving the same way, opening trade with anyone that requests it. I made sure the names were in all caps, and everything, but maybe there is something I am missing, I didn't have much time to play with it last night.
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Fri Dec 02, 2005 4:05 pm   
 
I'm gonna defer back to Ton since it's his code. I tested it, and it only auto-traded for me when the name was not on the BadList. If it was on the BadList then it echoed no trade. You mentioned you tried "several different things". I'd make sure all those "different things" have been deleted so they aren't conflicting with Ton's good script.
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
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