Just posting some of the old information from my bot for all you people still actively working on TwelveSky2 that may want to start to work on a memory based botting system.
To start with here are some of the structs I used for making my bot. This is the first time I had ever done something like this, so they are nowhere near professional or fully completed, but there fully working for main bot functions you may need(unless the game client changed drastically at some point):
The skillbar struct I used to read whatever skill was on the skillbar slot, so that the bot would automatically know where the skill was that needed to be used, so the user would not have to designate a Key for the skill. Here is my nooby C++ function that made for this. I could defiantly be a lot better for any of you C++ pros out there that may read this but with my limited coding skills this what I came up with:
Usage of the above function went something like this:
Code:
int CharFaction = MyFaction->faction;
int AOEID = GetAOEID(CharFaction);
int AOESlot = IMBClass.GetIDFromSB(AOEID);
int GetAOEID(int faction)
{
int aoeID;
if(faction == 0)
{
aoeID = IMBClass.SWIRLINGPHOENIX;
}
else if(faction == 1)
{
aoeID = IMBClass.DEADLYAVALANCHE;
}
else if(faction == 2)
{
aoeID = IMBClass.BATTLESONG;
}
return aoeID;
}
Using all of the above it has determined what faction your current character belongs to, associated your character with that factions AOE skill(no def weapons included, but could be added), and scans the skillbar for the ID of the associated AOE skill.
At this point you can make a bot to auto execute the AOE skill without having to designate a key for the slot the skill is located on:
Code:
UseSkill(0, 0, 0, AOESlot); // First Arg is Skillbar# and last is SkillbarSLot#, can't remember what the other 2 args are, don't need to be used anyhow.
Possibly more to come, I just posted this in hopes maybe I can get my interest in these things sparked back up again, maybe spark up some interest in other people here to dabble with it a bit and possibly get a bit of credit for once(na, doesn't matter).
Anyways, I have limited knowledge in these matters and just dabble with stuff here and there, reading info I find on gamehacking/coding forums and going from there.
Yet again big thanks to Megabyte for helping understand how to use structs in a bot. I read so many source codes for Source Engine games and COD games in the past trying to understand how they did it, but I never understood how to make use of the start address for the struct in C++ before this.
I may post some info on locating new addresses for the structs and a small sample project for an Auto-AOE bot with updated addresses.
Hopefully somebody will enjoy reading this(for purposes regarding bot making and not other reasons) and hopefully I can stop being lazy/distracted and further my knowledge in these areas as I really enjoy doing it when everything clicks.
Good luck.
Tools that I used:
Cheat Engine 6: You know where to find this.
Reclass: New version can be on UknownCheats.com
Ollydebug
Sample project posted. Just a simple dll that includes the updated Character and Skillbar structs and a small struct just for player faction.
I would add the AOE bot function to it, but I don't have a character with skills and don't feel like leveling so whatever.
For some reason the FullRecovery function is causing the client to crash, I haven't looked into it much but whos knows if they patched or something or I just forgot something.
There is also a compiled working copy included with the loaded that I used for the bot.
Features included:
MoveSpeed hack
Revive hack on keypress
Auto revive hack
Code:
void Hacks()
{
if(speed)
{
MyChar->MoveSpeed = speedset; //Variable set to 20, can change to whatever.
}
else
{
MyChar->MoveSpeed = normspeed; //Normal speed value 0.
}
if(GetAsyncKeyState(VK_NUMPAD3)) //Use revive if key is pressed, change to whatever.
{
if(MyChar->Animation = 12) //12 is the death animation value, set back to default of 1 and your good to go
{
MyChar->Animation = 1;
}
}
if(autorev) //Autorevive bool is set to true
{
if(MyChar->Animation = 12) //If char is dead then revive.
{
MyChar->Animation = 1;
}
}
}
Also everything in this is updated to use skills/items from the skillbar. You could make an Autobuffer or Autopet feeder with just a little bit of work if you really wanted to.
Using the these from the character struct, you can read when a particular buff is enabled or disabled:
For the rest of the buffs you'll just have to look at the struct in Ollydebug or Re-Class and use the buff you want to find, the value will be 0 to start with and change to something > 0 after you buff.
Now you can read how much food your pet currently has active with currentpetfood.
Code:
if(*currentpetfood == 0)
{
yourpetfeedfunctionhere; // its a different function from the Useskill(0,0,0,key) function, I just remembered I had to find a separate function for this while I was typing it up.
}
Will tell if your pet has no food.
You can just bind a key for pet food to be used from or use the SkillBar struct to read if you have petfood on the skillbar somewhere, it will then use the first stack of petfood found on the skillbar. Just make a function the same as the one I made for reading skills.
i think its useful. when you're starting out like I am, it's great to have code like this to see. especially when its code that pertains to the things i want to do. most code or examples in c++ tutorials don't cover things like this.
thanks again for contributing. :P
to be honest, i'm trying to apply this to one of my projects, but pointers are giving me a headache. i figured if i could learn how you and mega are able to find addresses through bytes then i wouldn't have to use pointers anymore. still can't figure it out, but its a work in progress. my physics teacher in high school says learning is in the struggle. i'm struggling like crazy, but its worth it.
Heres a couple of address ive found at character select/create
0118AEDC Selected Character
0118AEE4 Pose 0 Standing 1 Unsheath ready to attack 2 3 sword down defensive stance 4
1 3 5 7 are attacking like things
0 2 4 6 are standing still things
0118AEE8 Action Can be set to trigger Game Start
0118AEEC Frame
0118AF00 Direction
0118AEE0 Character Create selected weapon
0118AED8 Sub screen eg char select char create
With these memory address Things above this by Iktov and the username and password setting in my TSXClient thread a bot can be made that logs in to server selects char and logs into world. Using a dll with no packet sending*by our dll*, only memory modifications and calling game functions YAY
Also I deal with pointers *when coding* a lot like daily.
A pointer is just 4 bytes that point to an address in memory read it as unsigned int look at that in hex and bam thats the address. Or if its in code +EIP + 5 i think or +4 or we depending on size of opcode + paramaters to get address. *for things like CALL and JMP etc*
As for finding things as bytes just find a memory value you want find what reads or writes it. Make a signature from the code and read the memory address from it. Providing the code is simple like MOV EAX,[ADDRESS] you can read between the [] and do some maths to work out the address.
In the case of multi level pointers you just gotta keep going up till you find nothing else referencing it. The cheat engine tutorial covers them :P
Pointers aren't that big of a deal to me. It's just this 1 address that has been elusive. I can find all other pointers just fine except for this one hahaha. I'm gonna try something different with it today though.
Junk? Useful? Would anybody care to have any info on finding the functions, updating addresses ect..?
r u kidding me? for those how want to learn this is like a kid going to a toy store and allows to take out anything he likes for free. well, at least that's how i feel.
Ah well it might be in a class and accessed through class pointers. Wazapoo told me that ECX is usually used as a class pointer.
So you can look at the code and work it out by the maths done.
Another thing you can try is find what writes or accesses the variable then look in the window in CE for what accessed it click the line of code you want then click more information then you can see the registers at the time the line was executed so you can work out the pointer that way. It even tells you the pointer it may be.
Well from what I've analyzed I can see it might not be the pointers being my problem. I think the game stores the information in many different places in the game's memory and each location is pretty much random from the last. I have a couple different level 4 pointers and every time I load the game the information would show up in a couple of those pointers, but it's still random.
I gave up on it. hahah. It wasn't important anyway. It was just the name of the monster, npc, or other player that I click on. Thought it would come in handy for a simple bot that attacks based on names since the IDs were generated randomly.
Oh Blax found that a while back so did iktov and me and maybe afterburn im not sure.
Small character struct contains TargetID's after your X Z Y stuff theres like FF FF FF FF TARGETID1 TARGETID2
You can get a pointer to the small char/player update/action/world whatever struct/class easily ^_^ find the 01 00 00 00 for exists its above player name say -25? or -30 i forget got it written down somewhere. Then find what references that by searching its address as 4byte hex ^_^
Its monster and player targets. Theres also values for can attack or is attacking.
You can loop through the data of where monster spawns and item spawns are getting its pointer is much the same. Find the top of the struct/data its an exists 4 byte int 01 00 00 00 if monster or item is there 00 00 00 00 if it is not.
The ItemID or MonsterID is stored in the data theres also 2 unique ID's for these game objects. ive yet to find a relation.
[RELEASE] TwelveSky 2 - Trainer with various functions 01/09/2013 - 12Sky2 Hacks, Bots, Cheats & Exploits - 99 Replies http://img142.imageshack.us/img142/2389/capturelaf .jpg http://img20.imageshack.us/img20/2365/capture2ndd. jpg
Here is my first release of a simple trainer coded in VB.net (so you need .NET Framework to launch it). Nothing really new, but I coded it for me and I wanted the share it.
Use it at your own risk !! use town mode when in town or crowded area.
Features:
Autopotion
Moving speed hack with custom speed and teleport
[Release] Memory based auto functions 01/07/2011 - 12Sky2 Hacks, Bots, Cheats & Exploits - 6 Replies Hello,
Here is my attempt at making some functions witch I hope to eventually make a full Memory based bot out of.
Anyways below are the functions I have found so far for Sending Chat and Automating Skill Usage without the need for key presses or a complicated packet based system. With these functions you could make a bot that can work with the game client minimized. With the SkillUse func you could easily make it use AOE based on any factor that you can read from memory, such as...
[Request] Packet Structs 10/14/2008 - CO2 Private Server - 9 Replies So, has anyone structured the packets for patch 5017? If so, any change you could either post them here or PM them to me? I'm looking for complete structures so I don't need the actual code.