This is my second post in this thread... The first one I made I got accused of writing a hack. Id just like to start off saying that this is no such thing. If you would look at my code instead of just assuming you could see that.
Anyhoo. This is a small sub routine for my bot. The deal is when a player dies in the game a bounty number is displayed at the end of there name. The bounty number is always between brackets "(402)" And can be anywhere from (0) to (30000).
Now the issue is that i need to remove this number from there name so the bot can reply to them. Here is the code I came up with using regex.
Killed(0) is the person who got the kill
m is match. (each match in string)
Then item_index route is adding the name to a list for further processing.
What I was thinking could be done is some reverse parsing. Since the bounty is displayed at the end of a name and is always encapsulated in ()'s if there was some way to find the first ( from right to left in a string that would workCode:t = killed(0) re.Pattern = "\(*\d\d*\)$" re.Global = True For Each m In re.Execute(t) killed2 = Split(killed(0), m.Value) item_index = SendMessage2(List1.hwnd, LB_FINDSTRING, -1, killed2(0)) Next
Ah and on a side note the players name May or may not contain brackets.




Reply With Quote