ZacTheSin I post too much Reputation: 6
Joined: 09 May 2006 Posts: 2657
|
Posted: Thu Jul 16, 2015 11:02 pm Post subject: |
|
|
Ooh, somewhere I can help!
I had this exact same issue when creating a bot for another game.
I used a lua library called winapi by Steve Donovan (https://github.com/stevedonovan/winapi).
Here's it compiled with the current version of CheatEngine's libraries *CE6.4*.
Available via Hostr: https://hostr.co/KoMrvLM0H2ZW
Usage: https://raw.githubusercontent.com/Acen/FushBot/Script_Rewrite/FushBot.CT
Actual keypress usage from older version
Window select:
Code: | function windowSelect(fushBotSessionInt)
if(fushBotSessionInt == 0) then
windowSharedInteger = allocateSharedMemory("windowInteger", 4096)
sleep(100)
appWindow = winapi.find_window_match('Application Window Name')
if (windowSharedInteger < 1) or (readInteger(windowSharedInteger) < 1) then
writeInteger(windowSharedInteger, 1)
local appWindowName = 'FushBot' .. readInteger(windowSharedInteger)
appWindow:set_text(appWindowName)
appWindow = winapi.find_window_match(appWindowName)
print('fushBotSession:\t', readInteger(windowSharedInteger))
return(readInteger(windowSharedInteger))
elseif (windowSharedInteger > 0) then
writeInteger(windowSharedInteger, (readInteger(windowSharedInteger)+1))
local appWindowName = 'FushBot' .. readInteger(windowSharedInteger)
appWindow:set_text(appWindowName)
appWindow = winapi.find_window_match(appWindowName)
return(readInteger(windowSharedInteger))
else
print("Failed to find app client to connect new Fushbot session. Please try again.")
end --]]
elseif(fushBotSessionInt > 0) then
print('Existing Fushbot session found -- connecting ' .. fushBotSessionInt)
appWindow = winapi.find_window_match('FushBot' .. fushBotSessionInt)
return fushBotSessionInt
else
print('No session found. Please try again.')
end
end |
Code: | function castLine()
varFishingStatus = 1
if (readInteger(varLuresAvailable) > 0) then
if (readInteger(varLineCast) == 0) then
appWindow:send_message(7, 0, 0)
sleep(100)
appWindow:send_message(256, 70, 2162689)
sleep(10)
appWindow:send_message(257, 70, 2162689)
print('Casting Line')
sleep(3000)
else
print("Line already cast?")
end
else
print("No lures available, or in assigned inventory slot (bottom left).")
end
end
function catchFush()
if (readInteger(varLineCast) > 0) then
print("Reeling Line")
sleep(500)
appWindow:send_message(7,0,0)
sleep(100)
appWindow:send_message(256, 70, 2162689)
sleep(1)
appWindow:send_message(257, 70, 2162689)
sleep(3000)
varFishingStatus = 0
fushCaught = fushCaught + 1
if (fushCaught ~= 0) and (fushCaught % 5 == 0) then
print("Fish Caught:\t", fushCaught)
end
else
print("Line not cast? What in the world..?")
end
end |
Message me if you want finer detail. I'm not sure about what the rules are regarding specific detail when the code may have to do with an online game.
If you can't message - Skype: TheAcen
_________________
If someone helps you, why not Rep them? |
|