Any ideas on how to improve this?

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

BrainDeath
a ghoul
a ghoul
Posts: 86
Joined: Sun Mar 07, 2004 5:00 pm

Any ideas on how to improve this?

Post by BrainDeath » Fri Jul 16, 2004 10:29 pm

Here is a sub one of my macros uses to send text to the search field on the new tradeskill interface

Code: Select all

| Type out the input string.  Only non-alphabetic character 
| currently handled is space. 
Sub Type(InStr) 
   /declare char string local 
   /declare loopctr int local 
   /for loopctr 1 to ${InStr.Length} 
      /varset char ${InStr.Mid[${loopctr},1]} 
      /if (!${char.Length}) { 
         /keypress space chat 
      } else { 
         /keypress ${char} chat 
      } 
   /next loopctr 
/return
Does anyone have any idea how to modify this so that it will handle other characters such as (, ), ', etc.?

Thanks.

Sparr
a hill giant
a hill giant
Posts: 159
Joined: Mon Jun 24, 2002 5:41 am

Post by Sparr » Sat Jul 17, 2004 5:15 pm

you could write a second function that uses a lookup table of shifted keys, so you could convert ( into /shift /keypress 9