Rika2009-02-12 04:44:24
QUOTE (Zarquan @ Feb 12 2009, 12:58 AM) <{POST_SNAPBACK}>
You need to check 'Expand Variables' for @weapon1 to be converted.
There is no checkbox for that in the macros screen, though.
Esano2009-02-12 05:42:07
QUOTE (rika @ Feb 12 2009, 03:44 PM) <{POST_SNAPBACK}>
There is no checkbox for that in the macros screen, though.
You'll have to either set the macro to call an alias, or use the full GetVariable("variablename"), I expect.
Esano2009-02-12 05:46:46
QUOTE (Isuka @ Feb 12 2009, 09:13 AM) <{POST_SNAPBACK}>
Indeed, I can certainly just make it optional, but I'd like to know why this doesn't work so I don't run into the same problem later on.
What's funny to me is that the trigger does catch, I know it does because I've run several tests on it. The script just doesn't execute.
What's funny to me is that the trigger does catch, I know it does because I've run several tests on it. The script just doesn't execute.
As far as I can remember, the 'repeat on same line' option only works for highlighting, and not for scripting. You can, however, catch it all in a single trigger then split it up. You may also be able to use a series of triggers, each trigger capturing and processing only one of the positions in the rift list, but I haven't tried that myself.
Isuka2009-02-12 05:59:16
QUOTE (Esano @ Feb 11 2009, 09:46 PM) <{POST_SNAPBACK}>
As far as I can remember, the 'repeat on same line' option only works for highlighting, and not for scripting. You can, however, catch it all in a single trigger then split it up. You may also be able to use a series of triggers, each trigger capturing and processing only one of the positions in the rift list, but I haven't tried that myself.
I just ended up using a single trigger with optional elements to capture it all. Just wish I knew for certain why the other way didn't work.
Rika2009-02-12 08:05:24
Another question. Below is a bit of code I wrote. It's meant to change my nextweapon variable to 1 if it is on 0 and vice versa whenever I envenom my weapons. It seems to be firing, but the variable isn't changing. Any ideas?
CODE
^You rub some (.*?)$
if "@nextweapon" == 1 then
SetVariable ("nextweapon", "0")
else
SetVariable ("nextweapon", "1")
end
if "@nextweapon" == 1 then
SetVariable ("nextweapon", "0")
else
SetVariable ("nextweapon", "1")
end
Kuroi2009-02-12 08:29:52
QUOTE (rika @ Feb 12 2009, 08:05 AM) <{POST_SNAPBACK}>
Another question. Below is a bit of code I wrote. It's meant to change my nextweapon variable to 1 if it is on 0 and vice versa whenever I envenom my weapons. It seems to be firing, but the variable isn't changing. Any ideas?
CODE
^You rub some (.*?)$
if "@nextweapon" == 1 then
SetVariable ("nextweapon", "0")
else
SetVariable ("nextweapon", "1")
end
if "@nextweapon" == 1 then
SetVariable ("nextweapon", "0")
else
SetVariable ("nextweapon", "1")
end
A few problems here, firstly it should read @nextweapon, not "@nextweapon"
secondly, you are comparing the value to a number:
CODE
if "@nextweapon" == 1 then
but then trying to assign a string to it:
CODE
SetVariable ("nextweapon", "0")
so, if we correct these we get:
CODE
if @nextweapon == 1 then
SetVariable ("nextweapon", 0)
else
SetVariable ("nextweapon", 1)
end
Note(@nextweapon)
SetVariable ("nextweapon", 0)
else
SetVariable ("nextweapon", 1)
end
Note(@nextweapon)
Esano2009-02-12 08:35:05
QUOTE (Kuroi @ Feb 12 2009, 07:29 PM) <{POST_SNAPBACK}>
secondly, you are comparing the value to a number:
but then trying to assign a string to it:
but then trying to assign a string to it:
Mushclient stores all variables as strings anyway. Meaning that you need the quotes in the compare (if x == "y") but not in the assignment (for numbers, at least, although you should probably have them anyway for cleanliness' sake). Unless you use tonumber.
Rika2009-02-12 08:39:51
Thanks to Kuroi and Esano for the help. That part works now. Next problem! The following alias is meant to envenom mantakaya to my first weapon if nextweapon is set to 1 and to my second weapon if it is not set to one. What's wrong with it?
CODE
if nextweapon == "1" then
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Esano2009-02-12 08:43:41
QUOTE (rika @ Feb 12 2009, 07:39 PM) <{POST_SNAPBACK}>
Thanks to Kuroi and Esano for the help. That part works now. Next problem! The following alias is meant to envenom mantakaya to my first weapon if nextweapon is set to 1 and to my second weapon if it is not set to one. What's wrong with it?
CODE
if nextweapon == "1" then
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Unless you have nextweapon defined as a local variable or some such, it's null. Use GetVariable("nextweapon")
Rika2009-02-12 08:44:55
Aha! That worked. Thanks
Kuroi2009-02-12 08:47:06
QUOTE
Mushclient stores all variables as strings anyway. Meaning that you need the quotes in the compare (if x == "y") but not in the assignment (for numbers, at least, although you should probably have them anyway for cleanliness' sake). Unless you use tonumber.
ah yes true! well I still do it anyway for cleanliness' sake, the real problem is the quotes around the variable.
EDIT:
Also, if you want to carry on using variables the same way, this should work:
CODE
if @nextweapon == 1 then
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Aramel2009-02-12 09:02:23
I'm on Mushclient currently and I want to have MXP on to take advantage of Mudbot. However, it's messing me up in that all the < and > signs in Lusternia (such as for family tree and so on) get read by Mush as MXP tags, and then get omitted.
Is there any way for me to fix this, or do I just have to live with the random line truncations?
Is there any way for me to fix this, or do I just have to live with the random line truncations?
Unknown2009-02-12 09:20:49
AFAIK, there is no way around that. You either live with the omissions or live without MXP. (Though I suppose you could try some form of trigger to capture and re-echo certain things, like GTS, but I've never felt it worth looking into.)
Aramel2009-02-12 09:40:16
Thanks. I worked around it. I'd originally changed Treant's mapper around a bit so it captured the output of Mudbot's map window instead of the game map because MAP CONFIG ON was slowing me, and now I'm just triggering it to do lmap upon seeing room names, which isn't so different.
Edit: Another question: is it possible to get on-click scripts on Mush? I remember someone once made a shopping trigger that would probe things if you clicked them, that was useful.
Edit: Another question: is it possible to get on-click scripts on Mush? I remember someone once made a shopping trigger that would probe things if you clicked them, that was useful.
Chade2009-02-12 10:32:03
CODE
if @nextweapon == 1 then
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
If you use that method you need to clik on expand variables, I also have perfect success with if/then statements when I put both the variable name and the variable value in quotation marks so:
CODE
if "@nextweapon" == "1" then
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Send ("envenom @wea1 with mantakaya")
else
Send ("envenom @wea2 with mantakaya")
end
Aramel2009-02-12 11:01:21
That wasn't really what I meant, if you were replying to me. In ZMUD you could have this script that went:
#sub {~%1%2:~ }
and it would let you click on whatever it was you'd subbed in order to execute probe %2.
Edit: Oops, looks like you weren't talking to me. But anyway!
#sub {~
and it would let you click on whatever it was you'd subbed in order to execute probe %2.
Edit: Oops, looks like you weren't talking to me. But anyway!
Unknown2009-02-12 11:55:26
QUOTE (Aramel @ Feb 12 2009, 04:40 AM) <{POST_SNAPBACK}>
Thanks. I worked around it. I'd originally changed Treant's mapper around a bit so it captured the output of Mudbot's map window instead of the game map because MAP CONFIG ON was slowing me, and now I'm just triggering it to do lmap upon seeing room names, which isn't so different.
I use the in-game map mostly because it's more correct 90% of the time and actually helps me build my LMap. When you get tossed around by waves/earthquakes or otherwise moved to an unknown location, the in-game map tells you right where you are every time.
Everiine2009-02-12 16:15:03
QUOTE (Zarquan @ Feb 12 2009, 06:55 AM) <{POST_SNAPBACK}>
I use the in-game map mostly because it's more correct 90% of the time and actually helps me build my LMap. When you get tossed around by waves/earthquakes or otherwise moved to an unknown location, the in-game map tells you right where you are every time.
And thank goodness for that!
Rika2009-02-13 06:56:11
The IG map is better 99% of the time for normal exploring/ quick walking use. The LMap is better when you need to speedwalk to a place with just a vnum.
Unknown2009-02-13 11:57:03
Exactly. I'd rather see where I am using the in-game maps, but I speedwalk to everywhere using LMap, especially since it tells me the numbers on things like scrying, deathsight, etc.