Page 1 of 1
$merchant(has,"Item") is crashing me
Posted: Mon Oct 27, 2003 2:41 pm
by Joshjje
Code: Select all
Sub Main
/if $merchant(has,"Malachite)=="TRUE"
{
/press u
/delay 10
}
/return
This script right here is crashing me, it was working fine pre oct 25th build, and concurrent versions have been crashing me, i tried using the oct 24th build but then $merchant() gives me comparison errors whenever i use it...other people have told me it works fine for them but why should it be crashing for me? can someone please help me. The merchant window is open, the merchant has the item, etc. Using todays build right now.
Posted: Mon Oct 27, 2003 2:47 pm
by MacroFiend
You are missing a quote at the end of Malachite. Try putting the quote in and see if it still dies.
..
Posted: Mon Oct 27, 2003 3:31 pm
by Joshjje
Sorry that was a typo, still crashes...now for some strange reason im getting random crashes...grr i dont know
OK I again reverted back to the oct 24th build and ran through the WHOLE script with no errors, except for the $merchant(has still not working which i commented out, and $merchant() gives me comparison errors which doesnt end the macro, also in this part of code:
Code: Select all
/if $char(buff,1)~~"clarity" /return
/if $char(buff,1)==NULL /varset ClarityFlag 1
/if n @ClarityFlag>0 {
/target "myself"
/delay 10
/target myself
/cast 1
/delay 80
/varset ClarityFlag 0
}
when i have calrity 2 on it gives me 2 errors that say couldnt find comparison in 'clarity', and works fine if i dont have it on.
I just want to know if theres a reason why the oct 24th build runs fine save for the few errors and $merchant, while the new builds are crashing me to death. If anybody would like to contact me over AIM, or mIRC and look over my code or whatever id much appreciate it.
Posted: Mon Oct 27, 2003 4:07 pm
by Scrime
I think you are using $char(buff) incorrectly.
If I remember correctly $char(buff, spellname) returns the buff slot number for a buff, 0 if you dont have the buff. So for what you are trying to do, I think that:
Code: Select all
/if n $char(buff,"Clarity II")!=0 /return
would work much better.
I don't know about the other problems you are having.
Posted: Mon Oct 27, 2003 6:50 pm
by MacroFiend
Joshjje, the reason for your $char(buff,xxx) error is the same as what I ended up saying about your first error ... you need more quotes. If you are dealing with a spell that has a space in its name (a la "Clarity II"), you have to have quotes around it for the comparison. If you don't, when the parser goes through and does the replacements, you will end up with something that looks like ...
If you look at it like that, I'm sure you'll see why the quotes are so important. If you aren't dealing with a numeric comparison and you aren't absolutely sure you will never have a space in your variables, save yourself a bit of hassle and put quotes around both sides of the comparator. 4 extra characters won't add much to your script length ... but can save you hours of frustration when trying to debug.
..
Posted: Mon Oct 27, 2003 9:39 pm
by Joshjje
Ah yeah i see, the clarity issue is fixed, however, the $merchant(has, "itemname") still poses a problem.
Posted: Tue Oct 28, 2003 1:25 pm
by Kint
I was talking to someone the other night who was crashing with $merchant(has,XXX). he could echo it and it would work just fine but when he put it in a macro it crashed him hard.
..
Posted: Tue Oct 28, 2003 2:23 pm
by Joshjje
/echo $merchant(has, xxx) also crashes me, however, ill try out the new build maybe it works