Help - Search - Members - Calendar
Full Version: Mushclient Anti-theft (part)
Achaea's Forums > Off-Topic > Tech Support > Client Help
Serris
This is probably very simple and I'm making it difficult. Anyways, this is for an anti-theft script on MUSHClient and should do the following:

ggp: Sets "getting" to 1 and allows "get gold from @pack"

So if someone where to force me to get/take gold from pack, I would automatically put it back in save for when I use the alias ggp.

<variables>
<variable name="getting">0</variable>
<variable name="pack">111111</variable>
</variables>

<aliases>
<alias
match="ggp"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>SetVariable("getting", 1)
Send("get gold from @pack")
SetVariable("getting", 0)</send>
</alias>
</aliases>

<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^You get \d+ gold sovereigns from a canvas backpack\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>if getting == 0 then
send("put gold in @pack")
elseif getting == 1 then
((Not sure what I should put here, I had it set getting to 0 again but that seemed redundant and would probably just put the gold back in the pack but also returns the following error. So I guess putting in a #wait type of command would work although I heard this was a bad idea))
end -- if</send>
</trigger>
</triggers>

I get this error then then when I click ok it gets the gold from my pack.

QUOTE
Error number: 0
Event: Compile error
Description: [string "Trigger: "]:4: ')' expected near '0'
Called by: Immediate execution


I managed to make my own triggers to rewear on balance and such but I don't know what do do on this one.
Thanks in advance for any help.
Soludra
Okay, I see a problem in the alias. You set 'getting' to one, then get gold from your pack. Then you set 'getting' to zero. However, your command is still travelling over the network, and the server hasn't even attempted to retrieve gold from your pack, yet you've already decided "okay, I'm done getting". Your comment in bold in the trigger, mentioning about setting it to zero in the elseif, is exactly what you should be doing. Set 'getting' to 0 there, and not in the alias.

The idea is that the alias is requesting something from the server, and the trigger is the response. You tell the server you want to take gold from your pack, and set a variable locally so you won't reflexively tell it to put it back. Then, when the trigger sees that you did indeed take gold from your pack, it will also see 'getting' set to 1, so it knows it's probably not theft. And since it's already happened, you can just set 'getting' back to 0, so you're safe from theft again.

Make sense? smile.gif
Serris
xD My poor flawed logic. Well at least I'm trying.

I also needed needed to add
if @getting == 0 then

Thanks! ^~^
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.