MOD rod macro

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

cobra
orc pawn
orc pawn
Posts: 13
Joined: Wed Feb 11, 2004 5:38 am

MOD rod macro

Post by cobra » Mon Apr 12, 2004 4:52 am

hi guys first i want to say your MQ2 rocks.

ok i am after a little macro i can use with my mage when some on in group says anything with ROD in a sentence it will auto target them and cast rod
same in a tell if the mage recievs a tell he auto targets the sender and casts a mod rod now i have found somthing that is very close to doing it on the board it has a simple problem though i cant for the life of me work out .

Code: Select all


#chat group 
#chat tell


Sub main 

:Wait 
   /Doevents 
   /delay 1 
   /goto :Wait 

/return 


Sub Event_Chat(MsgType, MsgFrom, MsgData) 

/if "@ChatText"~~"rod" { 

      /echo @MsgFrom needs a rod. 
      /target PC @MsgFrom 
      /stand 
      /cast 8 
   } 
/return 



ok this works great if they say (RoD) but if they say (rod please ) or even a Rod with a space or any other charcter besides Rod  it just hangs up and dies  any ideas please would be greatly appreciated 
ps i got this from the search engine i have been looking for 3 days and 5 hours spent on this forum to try to find anything that works so please dont htink i didnt search
thank you for you help :)

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Mon Apr 12, 2004 6:08 am

I don't even see how you wouldn't have gotten it to work as is, you were trying to compare against a variable that doesn't even exist. I.E: @ChatText

Code: Select all

#turbo 50
#chat group 
#chat tell 


Sub Main 

:Wait 
/doevents 
/delay 1 
/goto :Wait 
/return 


Sub Event_Chat(MsgType,MsgFrom,MsgData) 
/if "@MsgData"~~"rod" { 
    /echo @MsgFrom needs a rod. 
    /target pc @MsgFrom 
    /stand 
    /cast 8 
} 
/return 
If you get a < > or ~ after the word 'rod' in the text that someone sends you it could throw the macro into a loop or just cause it to miss the match. Not sure if the new parm system has this problem or not but here is the code if you have the new parm system enabled. (Just checked, the new Find command doesn't get screwed up at all.) Also, keep in mind that you can't *test* this yourself because #chat is going to ignore anything coming from you. You would have to have someone else send you a tell or speak in group.

Code: Select all

#turbo 50
#chat group 
#chat tell 


Sub Main 

:Wait 
/doevents 
/delay 1 
/goto :Wait 
/return 


Sub Event_Chat(MsgType,MsgFrom,MsgData) 
/newif ${String["@MsgData"].Find["rod"]} { 
    /echo @MsgFrom needs a rod.
    /target pc @MsgFrom 
    /stand 
    /cast 8 
} 
/return 

cobra
orc pawn
orc pawn
Posts: 13
Joined: Wed Feb 11, 2004 5:38 am

Post by cobra » Mon Apr 12, 2004 7:14 am

i would like to say thank you for even taking the time to help me friend but it still wont work also my old macro wont work any more :( this one however does work but iam still having the same problem of any extra charcter or word locks macro up

Code: Select all

#chat group 
#chat tell
Sub main 

:Wait 
   /Doevents 
   /delay 1 
   /goto :Wait 

/return 


Sub Event_Chat(MsgType, MsgFrom, MsgData) 

/if n $strlen(@MsgData)>0 /if n "@MsgData"~~"rod" { 
/echo @MsgFrom needs a rod. 
/target PC @MsgFrom 
 /stand
/cast 8 
} 
/return 



I have tested with two accounts so testing is no problem
this does work great when the message is ROD both in group and in tell but if you say Rod please it hangs up
the macro you posted dose nothing at all when the rod text is in group or tell any help would be appreciated

forgive my ignorance how do you turn on new mq2 system i thought it was on all the time ?
thank you again for your patience :D

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Mon Apr 12, 2004 7:48 am

cobra wrote:i would like to say thank you for even taking the time to help me friend but it still wont work also my old macro wont work any more :( this one however does work but iam still having the same problem of any extra charcter or word locks macro up

Code: Select all

#chat group 
#chat tell
Sub main 

:Wait 
   /Doevents 
   /delay 1 
   /goto :Wait 

/return 


Sub Event_Chat(MsgType, MsgFrom, MsgData) 

/if n $strlen(@MsgData)>0 /if n "@MsgData"~~"rod" { 
/echo @MsgFrom needs a rod. 
/target PC @MsgFrom 
 /stand
/cast 8 
} 
/return 



I have tested with two accounts so testing is no problem
this does work great when the message is ROD both in group and in tell but if you say Rod please it hangs up
the macro you posted dose nothing at all when the rod text is in group or tell any help would be appreciated

forgive my ignorance how do you turn on new mq2 system i thought it was on all the time ?
thank you again for your patience :D
Dude,
I'm not sure what your problem is, but you just posted a macro that is doing a numeric /if of a string search.

Those macros I posted work just fine. If I log on my characters again and retest them and they work fine.... Then don't expect to hear from me again. If you need to figure out where to turn on the new parm system do a search.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Mon Apr 12, 2004 8:01 am

Ok this is the last time I'll be responding. Both macros work fine. Things to check:

If you aren't using notepad to copy this macro and save it. Do it.


If you are on a server like FV that all messages come to you with Soandso tells you, in Elvish, blah blah blah. Hate to say it, you are screwed. Unless of course you can search for messages by me and find where I posted the fix for chat parsing when racial languages are used. (Although, this doesn't seem like your problem.)


Final thing to check, I was testing this with both the old and new parm systems enabled. There *could* (although not very likely) be some sort of problem if you have one or the other enabled. Make sure you have the 4/9 version or higher. Do a search and find out how to enable the new parm. Compile. And then have fun.

cobra
orc pawn
orc pawn
Posts: 13
Joined: Wed Feb 11, 2004 5:38 am

Post by cobra » Tue Apr 13, 2004 2:32 am

Thank you Thank you this macro has been giving me a headache for a week it turns out i did not have the new data system enabled and i enabled it and now it works fine thanks so much for helping me .
YOU ROCK . :D