need help with my first 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

swc123
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sat Dec 13, 2003 4:04 pm

need help with my first macro

Post by swc123 » Sun Dec 28, 2003 9:42 pm

Im trying to create a macro that will allow other people to control me using tells. However when I run it i get an error saying Cannot find any spawns matching: (0-100) name. Any suggestions?

Code: Select all

#turbo
#chat tell
Sub Main
   /declare "controller" global
   /varset "controller" "@Param0"
   /target "@controller"
   :Loop
   /doevents
   /delay 1s
   /goto :Loop   
/return
Sub Event_chat(ChatType,Sender,ChatText)
   /if "@Sender"=="@controller"
   {
   /if "@ChatText"=="c" { /target "@controller" /assist /delay 1s /cast 2 }
   /if "@ChatText"=="h" { /target "@controller" /assist /delay 1s /cast 1 }
   /if "@ChatText"=="n" { /target "@controller" /assist /delay 1s /cast 4 }
   /if "@ChatText"=="9" { /target "@controller" /assist /delay 1s /cast 8 }
   /if "@ChatText"=="sotw" { /presskey 7 /delay 1s /presskey 0 /rsay MGB SotW inc }
   }
   /else /r AFK send tells to "@controller" if you need something
/return 

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

Post by ml2517 » Sun Dec 28, 2003 10:13 pm

Try this:

Code: Select all

#turbo
#chat tell
Sub Main
   /declare controller global
   /varset controller $lcase("@Param0")
   /target @controller
   :Loop
   /doevents
   /delay 1s
   /goto :Loop   
/return

Sub Event_chat(ChatType,Sender,ChatText)
   /declare SenderVar local
   /declare ChatTextVar local
   /varset SenderVar $lcase("@Sender")
   /varset ChatTextVar "$lcase("@ChatText")"
   /if @SenderVar==@controller {
   /if "@ChatTextVar"=="c" { 
       /target @controller 
       /assist 
       /delay 1s 
       /cast 2 
       }
   /if "@ChatTextVar"=="h" { 
       /target @controller 
       /assist 
       /delay 1s 
       /cast 1 
       }
   /if "@ChatTextVar"=="n" { 
       /target @controller 
       /assist 
       /delay 1s 
       /cast 4 
       }
   /if "@ChatTextVar"=="9" { 
       /target @controller 
       /assist 
       /delay 1s 
       /cast 8 
       }
   /if "@ChatTextVar"=="sotw" { 
       /press 7 
       /delay 1s 
       /press 0 
       /rsay MGB SotW inc 
       }
   } else { 
       /tell @Sender AFK send tells to @controller if you need something.
   }
/return