Page 1 of 1

Bug in ~~

Posted: Wed Aug 06, 2003 5:13 pm
by AarynD
I'm getting a bug in a short little macro I sometimes run.

I'll have to edit this later on cuz the actual code is at home, but I think I can get the gist of it here...

The macro monitors the tell channel, and if 'ROD' occurs anywhere in the uppercase converted tell, the macro targets the person, and summons an item for them. Works great except in one instance...

If someone sends me a tell with the char "<" in it, it fires the macro. Being a lovable person for the most part, I get tells all the time like "<hugs>" and stuff, and it always fires off an immediate response and casts the spell at the offender.

Going from memory, with P2 being the var holding the actual text of the tell, I believe the code is:

if $ucase($p2)~~"ROD" then { target, send tell, and cast my spell }

Any ideas? I'll post the actual code later on for this, as well as some workarounds I've tried (which all should work, but also give errors unable to resolve certan functions).

- Aaryn

Posted: Thu Aug 07, 2003 7:51 am
by AarynD

Code: Select all

#include SpellSub.mac 

#chat tell 

Sub Main 
    :loop  
      /doevents 
    /goto :loop 
/return 


Sub Event_Chat 
/varset v33 $p1 
/if "$ucase($p2)"~~"ROD" {
/echo Tell from $p1
/target $v33
/sit off
/tell $v33 INC Rod
/call spellsub 5 4.5 
}
/doevents 
/return 
The /if clause causes a problem everytime someone sends me a tell with "<" in it as described above.

- Aaryn

Bug

Posted: Fri Aug 08, 2003 12:39 am
by grimjack
It loos like a bug. I would switch to == instead of ~~. == matches exact strings and may not have the same problem.

Thanks
GrimJack

Posted: Fri Aug 08, 2003 2:52 am
by papiraul
I think == is bugged too..

Atleast the standard sellitem.mac is not working as it should be now..