Obtaining information from the MUD.

Posted by FishOnSpeed on Mon 19 Nov 2007 01:00 PM — 9 posts, 30,862 views.

USA #0
to get information from the mud do i have to use triggers to pick up the variables or can i get them without having them show up on the screen.

i want to get level, stats, and such, store them in variables without having to open up the "score" and having
twenty different triggers to pick it all up.
Amended on Mon 19 Nov 2007 01:01 PM by FishOnSpeed
USA #1
Unless your MUD has some kind of behind-the-scenes communication (which is very unlikely) you don't really have any choice but to make the MUD communicate the information to you one way or another and pick it up with triggers. Kind of unfortunate but the way it is.
USA #2
ah ok.

well what i want to do is have a trigger pick up the information given on an auction channel.

* is auctioning a * (Level *, Num *). Current bid is *.

so my trigger so far would be

* is auctioning a * (Level *, Num *). Current bid is *.
send
bidnum = %4
bid bidnum <<< my problem is here

what is the syntax for putting bidnum there
so it would output to the mud something like

bid 74 where bidnum is equal to 74
Australia Forum Administrator #3
Have you read http://www.mushclient.com/faq - in particular, point 31? That deals with doing arithmetic in scripts.
USA #4
<send>
rats = (rats or 0) + 1
Note ("You have now killed ", rats, " rats")
</send>

is what is in point 31

* is auctioning * (Level *, Num *). Current bid is *.
<send>
bidnum = %4
note("bid ",bidnum)
</send>

trigger still doesnt work

Pappi is auctioning a black diamond earring (Level 17, Num 267). Current bid is 100.
bidnum = 267
note("bid ",bidnum)
[ 336/336hp 306/306mn 838/838mv 983tnl] > *[NOEXP]* Sorry Pappi, I don't understand you.
[ 336/336hp 306/306mn 838/838mv 983tnl] > *[NOEXP]* That is not a command. Type 'Commands' for a complete list.

is what gets put out when something is auctioned

its not showing an error but its also not doing what i want
i just want it to send the command

bid bidnum, where bidnum is equal to whatever auction number just popped up
Australia Forum Administrator #5
Can you paste here your whole trigger, not just selected bits of it?

http://www.mushclient.com/copying
USA #6
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="* is auctioning * (Level *, Num *). Current bid is *."
sequence="100"
>
<send>@bidnum = %4
bid @bidnum
</send>
</trigger>
</triggers>

this is my trigger

when it executes it prints out to the client

=54 or whatever the bid number was
then
bid it does not include the number after bid


Australia Forum Administrator #7
OK, I see what you are doing. When you expand variables, it only expands their current value, it doesn't let you replace it (the way you did it). The simple solution is this:


<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   match="* is auctioning * (Level *, Num *). Current bid is *."
   sequence="100"
  >
  <send>bid %4
</send>
  </trigger>
</triggers>


That simply bids the auction number without changing any variables.

If you really want to set a variable, this will do it:


<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   match="* is auctioning * (Level *, Num *). Current bid is *."
   send_to="12"
   sequence="100"
  >
  <send>
SetVariable ("bidnum", "%4")
Send ("bid " .. GetVariable ("bidnum"))
</send>
  </trigger>
</triggers>



Here I have changed it to "send to script", and in the script used SetVariable to set a variable, and GetVariable to get that variable's value back.
USA #8
ah ok thanks