Problem parsing /@somestring

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

Marze
a lesser mummy
a lesser mummy
Posts: 60
Joined: Wed Apr 14, 2004 12:08 pm

Problem parsing /@somestring

Post by Marze » Thu Apr 15, 2004 12:55 am

Code: Select all


Sub Event_Chat(MsgType, MsgFrom, MsgData)

      /declare mylength local
      /varcalc mylength $strlen($char(name))+2  

      /if "$left(@mylength,"@MsgData")"=="$char(name) /" {
          /declare stringlength local
          /varcalc stringlength $strlen("@MsgData")
          /varsub stringlength @mylength
          /declare outputstring local
          /varset outputstring "$right(@stringlength,"@MsgData")"
          /@outputstring

         }
This code looks for commands in the form of "MyName /xxxx" and then tries to cary out "/xxxx" but that very last line will not execute. I have confirmed that it holds the command that I intended for it to hold by use of an /echo test. I've also tried /"@outputstring". The help command talks about individual key presses but not sending entire strings to the chat prompt.[/code]

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

Post by ml2517 » Thu Apr 15, 2004 1:03 am

That wouldn't work the way you are trying to do it. You *might* be able to use docommand to do something like that though. Back before docommand existed I had to build something for this into autolink.mac.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 15, 2004 2:09 am

Yes that's what docommand is for.

The @ is parsed AFTER the command is decided, because some commands will not work correctly if the variables are parsed beforehand.

/docommand /@outputstring
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Marze
a lesser mummy
a lesser mummy
Posts: 60
Joined: Wed Apr 14, 2004 12:08 pm

Post by Marze » Thu Apr 15, 2004 11:17 am

Works perfectly thanks!