• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • Hail Guest, RedGuides is proud to announce the official release of MacroQuest, which we're now using as the base for Very Vanilla. Join the release party!
  • IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->

MQ2 arrays (1 Viewer)

edud

Member
Joined
Apr 5, 2006
RedCents
31¢
Hi there,
im not sure if this is possible but im trying to make an array from a random string
ie

mystring = TEST

myarray[0] = T
myarray[1] = E
myarray[2] = S
myarray[3] = T

any help would be appreciated
 

edud

Member
Joined
Apr 5, 2006
RedCents
31¢
im trying to make a macro that has user input before the macro is run like
/macro mymacro TEST

then i want to take the variable, (in example, TEST) and split it at each letter and end up with an array as mentioned above

hope this makes better sense
 

EvenLessSpam

Well-known member
Joined
Oct 31, 2005
RedCents
81¢
This is made of the top of my head. Untested.

Rich (BB code):
Sub Main(string myString)
    /declare lnString               int     local   ${myString.Length}
    /declare arString[${lnString}]  string  local
    /declare i                      int     local   0
    /for i 1 to ${lnString}
        /varset arString[${i}] ${myString.Mid[${i},1]}
    /next i
/return
 
Last edited:

Users who are viewing this thread

Top