Bug in ~~

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

AarynD
a lesser mummy
a lesser mummy
Posts: 45
Joined: Thu Jan 02, 2003 11:25 am

Bug in ~~

Post by AarynD » Wed Aug 06, 2003 5:13 pm

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

AarynD
a lesser mummy
a lesser mummy
Posts: 45
Joined: Thu Jan 02, 2003 11:25 am

Post by AarynD » Thu Aug 07, 2003 7:51 am

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

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Bug

Post by grimjack » Fri Aug 08, 2003 12:39 am

It loos like a bug. I would switch to == instead of ~~. == matches exact strings and may not have the same problem.

Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

papiraul
a lesser mummy
a lesser mummy
Posts: 76
Joined: Fri Sep 27, 2002 8:46 am

Post by papiraul » Fri Aug 08, 2003 2:52 am

I think == is bugged too..

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