Smart Looter

Scripts and support for your favorite MUD client.
Kozzloz
Sojourner
Posts: 21
Joined: Tue May 22, 2001 5:01 am
Location: Pocatello,ID USA

Smart Looter

Postby Kozzloz » Mon Nov 05, 2001 8:22 am

Ok... here is my problem. I want to write a smart trigger to loot only gold and platinum and drop the silver and copper... I can't seem to be able to seperate silver and copper if I use silver|copper in the trigger.

My trigger pattern is
There were: (%d) (%w) %w, (%d) (%w) %w, (%d) (%w) %w.

and the command is

#if (%2 = "silver") {drop %1 %2} {put %1 %2 llewyrr}

I want to expand each #if command to have silver and copper but I can't figure out what syntax to use in order for it to recognize silver and copper individually.


[This message has been edited by Kozzloz (edited 11-05-2001).]

[This message has been edited by Kozzloz (edited 11-05-2001).]
Drevarr
Sojourner
Posts: 25
Joined: Tue Jan 30, 2001 6:01 am
Location: Georgia
Contact:

Postby Drevarr » Mon Nov 05, 2001 12:11 pm

How about checking a string list of coin types:

#VAR Coin_Type {Silver|Copper}
#if %ismember(%2, @Coin_Type) {Drop %1 %2} {Bag %1 %2}
Kozzloz
Sojourner
Posts: 21
Joined: Tue May 22, 2001 5:01 am
Location: Pocatello,ID USA

Postby Kozzloz » Mon Nov 05, 2001 12:35 pm

I'll give it a try tomorrow and see how it works... Thanks for the input, and I knew it was something as simple as this... hehe
Gindipple
Sojourner
Posts: 676
Joined: Fri Jan 26, 2001 6:01 am
Location: O' Fallon, MO. USA
Contact:

Postby Gindipple » Mon Nov 05, 2001 3:35 pm

I used to have many triggers for loot until I condensed them down.
I thought of making it all one slick complex trigger, but then the KISS principle snuck in.
Best I came up with was 4 triggers that look something like this.
#TR {There were:%s(%d) copper} {split %1}
#TR {There were:%s(%d) silver} {split %1}
#TR {There were:%s(%d) gold} {split %1}
#TR {There were:%s(%d) platinum} {split %1}

Simply change the copper one from split to drop if you like.
Kozzloz
Sojourner
Posts: 21
Joined: Tue May 22, 2001 5:01 am
Location: Pocatello,ID USA

Postby Kozzloz » Mon Nov 05, 2001 7:55 pm

I tried
#TR {There were:%s(%d) copper} {drop %1 c} {autoloot}
#TR {There were:%s(%d) silver} {drop %1 s} {autoloot}
#TR {There were:%s(%d) gold} {put %1 g llewyrr} {autoloot}
#TR {There were:%s(%d) platinum} {put %1 p llewyrr} {autoloot}
and it only puts the platinum in my bag and that's it.... *scratch*
Gindipple
Sojourner
Posts: 676
Joined: Fri Jan 26, 2001 6:01 am
Location: O' Fallon, MO. USA
Contact:

Postby Gindipple » Mon Nov 05, 2001 8:32 pm

Kozz, your posted e-mail doesn't seem to work.
I'll look over the triggers tonight at home to verify them, but no odea as to why they didn't work for you yet.
Kozzloz
Sojourner
Posts: 21
Joined: Tue May 22, 2001 5:01 am
Location: Pocatello,ID USA

Postby Kozzloz » Mon Nov 05, 2001 9:34 pm

Ok I figured out how to write it using my first set of commands and I feel incredibly stupid/dumb/unintelligent/etc hehe...

All I needed to do was....
#if (%2 = "copper" OR %2 = "silver") {drop %1 %2} {put %1 %2 bag}

Hehe ahh well...
Drevarr
Sojourner
Posts: 25
Joined: Tue Jan 30, 2001 6:01 am
Location: Georgia
Contact:

Postby Drevarr » Mon Nov 05, 2001 9:43 pm

%s only matches whitespace and tabs.

This trigger:
#TR {There were:%s(%d) copper} {drop %1 c} {autoloot}

Doesn't match if multiple coin types are in the text recv'd from the mud.
Gindipple
Sojourner
Posts: 676
Joined: Fri Jan 26, 2001 6:01 am
Location: O' Fallon, MO. USA
Contact:

Postby Gindipple » Mon Nov 05, 2001 9:57 pm

Yea it was off the top of my head, now that ya mention it it might need an *

#TR {There were:*%s(%d) copper} {drop %1 c} {autoloot}
fildur
Sojourner
Posts: 143
Joined: Wed Nov 07, 2001 6:01 am
Location: rinkeby

Postby fildur » Fri Nov 09, 2001 11:18 pm

a workaround could be to define the action something like (ill do it so it works in powwow):
#action >+autolooter There were:={#action +workaround;sco}
#action >-workaround Coins carried: &1 platinum &2 gold &3 silver &4 copper={put $1 p bag;put &2 g bag;dro $3 s;dro $4 c;#action -workaround}

shouldnt it look somethin simmilar in zmud?//fil

[This message has been edited by fildur (edited 11-09-2001).]

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 12 guests