I'm running win7 on a 64bit machine and have found that I can run the bot on some characters and not others (mainly not). HAve been debugging and learning hte code base at the same time so its taken me a while but I've narrowed the problem down to the LoadTables_memory routine in the memorytable.lua file.
What seems to be happening is that the code runs through the in-memory tables in reverse order finding ranges of id's (item I'ds I assume). This works fine in most cases, however I get a scenario where the range looks like this (just listing the id's sequentially as they are in memory - yes, they are just the last 3 digits too as I'm lazy):
nil, 866,
867, 865, 864, 863, 863....
As you can see, the 867 is out of order and this causes a problem with the code, in that it finds the range from 863 to 865, records that, then finds the 867-867 range, records that
all good.
however, next it gets the 866, finds there is a nil next, so looks for the rest of the range (867) and finds that again, so adds the 866-866 range and continues from 867 - resulting in an infinite loop from 867 to 866 and then back.
I ended up changing the code in the GetNextTableAddress function to test the Tables to see if the item has already been added before just blindly returning the address of 867. i.e.:
Code: Select all
local function CheckAddress( addressToCheck )
-- Check the 0x4 offset address
local tmpAddress = memoryReadInt( proc, addressToCheck + 0x4 )
if ( tmpAddress ~= nil ) then
if tmpAddress > highestAddress then
return tmpAddress
end
local tmpId = memoryReadInt( proc, tmpAddress + addresses.idOffset )
if tmpId > lastId and tmpId < 999999 and [color=#FF0000](GetItemAddress(tmpId) == nil)[/color] then
return tmpAddress
end
end
-- Check the 0x8 offset address
local tmpAddress = memoryReadInt( proc, addressToCheck + 0x8 )
if ( tmpAddress ~= nil ) then
if tmpAddress > highestAddress then
return tmpAddress
end
local tmpId = memoryReadInt( proc, tmpAddress + addresses.idOffset )
if tmpId > lastId and tmpId < 999999 and[color=#FF0000] (GetItemAddress(tmpId) == nil)[/color] then
return tmpAddress
end
end
return nil
end
Possibly not the best solution as it reports some failures, but it works for now at least
I'm sure you can prolly come up with a better solution tho.