Help - Search - Members - Calendar
Full Version: Targetting Error In Mush
Achaea's Forums > Off-Topic > Tech Support > Client Help
Rire
Just trying to make a simply targetting alias in mush for my monk combos.

CODE
t *

executes
CODE
SetVariable("Target", %1)

send to script

and the error I get
CODE
[string "Alias: "]:1: bad argument #2 to 'SetVariable' (string expected, got nil)
stack traceback:
    [C]: in function 'SetVariable'
    [string "Alias: "]:1: in main chunk


so close to having a very, very basic system in MUSH so I can switch from Nexus, this is just the last piece. any help is appreciated!
Serris
SetVariable("target", "%1")

Remember the quotes around %1. I like confirmation and use
SetVariable("target", "%1")
Note("Target set to %1")
Rire
Awesome, thank you. Works perfectly now. But then I go bashing only to find my autosipper isn't working. Mind helping me? It's pretty simple, here it is:

the trigger
CODE
^Health:\s+\d{1,4}\s/\s(\d{4})\s{5}Mana:\s+\d{1,4}\s/\s(\d{4})$

executes
CODE
SetVariable("maxhealth", %1)
SetVariable("maxmana", %2)
SetVariable("siphealth", %1-750)
SetVariable("sipmana", %2-550)
SetVariable("mosshealth", %1-1100)
SetVariable("mossmana", %2-1600)



the trigger
CODE
^(\d{1,4})h, (\d{1,4})m \w*-

executes
CODE
SetVariable("currenthealth", %1)
SetVariable("currentmana", %2)

if @currenthealth < @siphealth and @healbalance == "1" then
send("sip health")
SetVariable("healbalance", 0)
end


And a bunch of "your mind feels stronger and more alart" blah blah blah to set healbalance to 1 or 0 as needed. And the variables seem to be set fine, my maxhealth/mana and siphealth/mana and currenthealth/mana are correct. It's simply not sipping when my health goes down. wacko.gif
Serris
xD wow, okay I get all that but am terrible at scripting. Still trying to figure out how to change Trevize ATCP into Triggers for his Gauges plugins. <.< You should figure that out for me. Actually I'd just like to know what variables I need to set and send.

You can continue the quotations around the %numbers. Odd that it wouldn't work on the targeting alias but does with these setaliases

The qsc you're using, try

^Health:\s+\d{1,4}\s*/\s*(\d{4})\s+OR {5}Mana:\s+\d{1,4}\s*/\s*(\d{4})$

to account for the spaces. Not sure why you had {5} and not {1,4} on the {4}s there but again, not good with codes and I'll most likely break this one.

I'd use
^(\d+)h, (\d+)m c?e?x?k?d?b?-(.*)$
or
&lt;*/*hp */*m&gt;
for a prompt trigger but most likely yours is better. Not sure if mine accounts for kai trance which yours might. I need to learn regex better P:

EDIT: Another thing you may have to do is make a functions to call those variables even though they're expanded.

Save your work before doing this! *shifty*
Rire
QUOTE (Serris @ Mar 27 2009, 05:03 AM) *
xD wow, okay I get all that but am terrible at scripting. Still trying to figure out how to change Trevize ATCP into Triggers for his Gauges plugins. <.< You should figure that out for me. Actually I'd just like to know what variables I need to set and send.

What's Trevize ATCP? Sounds interesting.

QUOTE (Serris @ Mar 27 2009, 05:03 AM) *
You can continue the quotations around the %numbers. Odd that it wouldn't work on the targeting alias but does with these setaliases

Ok, I'll try that

QUOTE (Serris @ Mar 27 2009, 05:03 AM) *
The qsc you're using, try

^Health:\s+\d{1,4}\s*/\s*(\d{4})\s+OR {5}Mana:\s+\d{1,4}\s*/\s*(\d{4})$

to account for the spaces. Not sure why you had {5} and not {1,4} on the {4}s there but again, not good with codes and I'll most likely break this one.

I had {5} because in my qsc prompt there are always 5 spaces between the max health number and 'Mana:'
QUOTE (Serris @ Mar 27 2009, 05:03 AM) *
I'd use
^(\d+)h, (\d+)m c?e?x?k?d?b?-(.*)$
or
&lt;*/*hp */*m&gt;
for a prompt trigger but most likely yours is better. Not sure if mine accounts for kai trance which yours might. I need to learn regex better P:

EDIT: Another thing you may have to do is make a functions to call those variables even though they're expanded.

Save your work before doing this! *shifty*

do you mean calling function with

local X == GetVariable("X") ? I'll try your prompt trigger, but tbh I haven't learned what all the letters at the end before the dash mean yet, so.....

Anyways, thanks for taking the time to give some pointers
Serris
Exactly. Or you could script it like:
maxhealth = getvariable("maxhealth") // of course I on second thought this seems redundant xD

and code like:

if health < (maxhealth*(percent)) then
dosip ("health")
elseif mana < (maxmana*(percent)) then
dosip ("mana")

This would be best if your setting priorities and such.

Another way to call the variables would be to make it a pure script. Have qsc run and set the stats like you did and make the rest functions:
local hp, max_hp = tonumber (wildcards [1] referring to %1), tonumber (wildcards [2])

BUT some scripter I hope will come by and fix all the atrocities I've done to these codes. Worth a try at least.

Trevize script creates stat bars like what you see in Nexus as well as a compass and each work but the problem is they get the variables from an ATCP plugin which is replaced (I'm guessing) When a system like Vadis is used or most of the curing systems. Props to him for the scripting work though. If you manage to figure it out, let me know until then I'll keep at it. And its probably something -really- simple.

http://forums.achaea.com/index.php?showtop...amp;mode=linear
or http://forums.achaea.com/index.php?showtopic=34188&st=0 without the graphics and sidepanel.

Anyways, hope I didn't confuse everything. I'm still learning all of this myself. The way you have it set up seemed far more simple and streamlined so at first glance it looks like it should work fine. =/
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.