View Single Post
02-25-15, 12:06 PM   #5
Mercian
A Murloc Raider
Join Date: Apr 2012
Posts: 6
Originally Posted by Elkano View Post
Never did much work with GUIDs myself, so I don't know which is used for what, sorry.

But regarding getting the first part of the string, your syntax for :sub is wrong (e.g. starts at 5th char and includes the dash).

You could try one of the following:
Code:
bb = strsplit("-", casterGUID) -- split string on dashes, assign the first resulting string to BB, discard rest
bb = strmatch(casterGUID, "^([^-]+)") -- get the longest sequence of non-dash characters starting at the beginning of the string
Hi,

thanks for your suggestion.

But as UnitType can also be "Pet" it would not be the longest sequence of non-dash characters.
I will check if my idea is working
  Reply With Quote