blackdtools / Blackd-Proxy-CLASSIC

Blackd Proxy CLASSIC
MIT License
9 stars 7 forks source link

The "highlight executing line" isn't always up to date #8

Closed divinity76 closed 9 years ago

divinity76 commented 9 years ago

the "highlight executing line" code isn't always up to date, there's many places scattered around where the executing line could get updated,

as such, i propose a new function called updateExeLine,

Public exeLine() As Long ' please use updateExeLine instead when changing
' Sid=client id
' newExeLine= new line you want to set.
'RelativeToOldLine = should the new line number be relative to the old line (+1?), or absolute?
'returns: the new executing line number
Public Function updateExeLine(ByVal Sid As Long, ByVal  newExeLine As Long, ByVal  RelativeToOldLine As Boolean) As Long
'Static exeLine() As Long
If (RelativeToOldLine = True) Then
exeLine(Sid) = exeLine(Sid) + newExeLine
Else
exeLine(Sid) = newExeLine
End If
If (modMap.cavebotIDselected = Sid) Then
frmCavebot.lstScript.ListIndex = exeLine(Sid)
End If
updateExeLine = exeLine(Sid)
End Function

and replace most of the exeLine(Sid) = exeLine(Sid) + 1 with updateExeLine(Sid,1,true) and replace most of the exeLine(sid) = 0 with updateExeLine(Sid,0,false)

i can't submit a patch right now, as my current local blackd code won't compile, but i can do it later~ this should ensure that the frmCavebot.lstScript.ListIndex is always up to date (which it isn't now)

btw, when this highligh code feature is functioning correctly, it helps a lot in debugging large cavebot scripts!

blackdtools commented 9 years ago

ok, I will do that change. I will update all to Tibia 10.74 at same time. I might take some hours.

blackdtools commented 9 years ago

Tibia 10.74 - They added something in the start of the login packet that contains your char list. Subpacket type is &H28. It only contains a typical Tibia string (2 bytes for string length, then the string) The string contains something that looks like a random generated password. Maybe it have something to do with the new "Stay logged in for session" checkbox. Or it might be a crc to check if bot modified charlist ips to redirect it to localhost. I don't really know yet. For now I will just skip this subpacket. Anyways I can't test anything now because tibia.com main server is totally crashed at this moment. I will not release any update without doing some basic tests there.

divinity76 commented 9 years ago

i have no idea about the 10.74 update, but at least the "highlight executing line" code is working now ^^ closing this "issue"