[HELP]CTM auto loot prob menu

User Tag List

Results 1 to 13 of 13
  1. #1
    kosacid's Avatar Active Member
    Reputation
    19
    Join Date
    May 2009
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP]CTM auto loot prob

    for some reason when i InteractObject it opens up fine but auto loot stops working eny ideas ???

    [HELP]CTM auto loot prob
  2. #2
    FinnX's Avatar Banned
    Reputation
    40
    Join Date
    Aug 2009
    Posts
    82
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean with "stops working"? Make sure you have slots in ur bag, and that Auto Looting is activated.


  3. #3
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or set the CVar, f.e. via Lua
    Code:
    SetCVar('AutoInteract', 1)

  4. #4
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    If your using ctm interact I think you need to move a little for it to work, or just use API LootSlot - WoWWiki - Your guide to the World of Warcraft

  5. #5
    kosacid's Avatar Active Member
    Reputation
    19
    Join Date
    May 2009
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ill explain a bit more if i go up to a herb and right click it loots fine when i use
    Code:
    void Farm(float x,float y,float z,UINT64 obj)
    {
    	bool Wait=true;
    	while(Wait)
    	{
    		CMOVE(x,y,z,WalkTo,0);
    		if(x - mx < 6.0f && x - mx > -6.0f && y - my < 6.0f && y - my > -6.0f)
    			Wait = false;
    	}
    	CMOVE(0,0,0,InteractObject,obj);
    	Sleep(5000);
    	bObjFound = false;
    }
    it opens the loot window and i have to click on the loot to loot it

  6. #6
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's just that interact via CTM won't fire the function to start looting.

    Write the GUID of the object into the LastTargetAddress, press the button to select the last target and then use the interact key. Another way is the mouseover-guid and interact via mouseover


    (Or simple call Interact in the VMT, which is at position 45 right now and can be reversed with the help of Lua_InteractUnit)

  7. #7
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I tried to loot via CTM, it didn't auto loot either, regardless of the CVar setting... Also, it sometimes would be out of range to loot when it had to move towards the corpse.
    Use Interact like Frosttall told.

    Needless to say, your distance check is more than flawed...

  8. #8
    kosacid's Avatar Active Member
    Reputation
    19
    Join Date
    May 2009
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no distance check is fine works every time it just wont auto loot but its working fine now i went with
    Code:
    void Farm(float x,float y,float z,UINT64 obj)
    {
    	bool Wait=true;
    	while(Wait)
    	{
    		CMOVE(x,y,z,WalkTo,0);
    		if(x - mx < 20.0f && x - mx > -20.0f && y - my < 20.0f && y - my > -20.0f)
    			Wait = false;
    	}
    	WriteProcMem((LPVOID)(MouseOverGUID),&obj, 8);
    	::PostMessage(hwnd, WM_KEYDOWN, 0x08 , 0);
    	::PostMessage(hwnd, WM_KEYUP, 0x08 , 0);
    	Sleep(5000);
    	bObjFound = false;
    }
    i set backspace in game on my mouse over interact
    loots every time now
    i put it in a loop just to make sure it keeps moving and it kills the loop when its close enough its only a test for now ill post the full test soon
    its just for when your flying about it gose and grabs the nodes for you or herbs
    i just hate staring and the mini map lol
    Last edited by kosacid; 08-24-2012 at 05:22 AM.

  9. #9
    kosacid's Avatar Active Member
    Reputation
    19
    Join Date
    May 2009
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    based on 3.3.5

    header.h
    Code:
    #include <Windows.h>
    #include <iostream>
    #include <string>
    #include <list>
    #include <math.h>
    #include <tlhelp32.h>
    
    #define foreach(lst, type, var) for(list< type >::iterator var = lst.begin(); (var != lst.end()); var++)
    using namespace std;
    typedef unsigned int uint;
    #define PI 3.14159265
    
    enum ObjectManager
    {
        CurMgrPointer = 0x00C79CE0,
        CurMgrOffset = 0x2ED0,
        NextObject = 0x3C,
        FirstObject = 0xAC,
        LocalGUID = 0xC0,
    	MouseOverGUID = 0x00BD07A0,
    	CurrentTargetGUID = 0x00BD07B0,
    };
    
    enum ObjectOffsets
    {
        Pos_X = 0x798,
        Pos_Y = Pos_X + 0x4,
        Pos_Z = Pos_X + 0x8,
        Rot = Pos_X + 0x10,
    	ObjectName1 = 0x1A4,
        ObjectName2 = 0x90,
    	GameObjectX = 0xE8,
        GameObjectY = GameObjectX + 0x4,
        GameObjectZ = GameObjectX + 0x8,
    };
    
    enum Action
    {
    	FaceTarget = 0x1,
        Stop = 0x3,
        WalkTo = 0x4,
        InteractNpc = 0x5,
        Loot = 0x6,
        InteractObject = 0x7,
        Unknown1 = 0x8,
        Unknown2 = 0x9,
        AttackPos = 0xA,
        AttackGuid = 0xB,
        WalkAndRotate = 0xC
    };
    
    enum ClickToMove
    {
        CGPlayer_C__ClickToMove = 0x00727400,
        CTM_Activate_Pointer = 0xBD08F4,
        CTM_Activate_Offset = 0x30,
        CTM_Base = 0x00CA11D8,
        CTM_X = CTM_Base + 0x8C,
        CTM_Y = CTM_Base + 0x90,
        CTM_Z = CTM_Base + 0x94,
        CTM_TurnSpeed = CTM_Base + 0x4,
        CTM_Distance = CTM_Base + 0xC,
        CTM_Action = CTM_Base + 0x1C,
        CTM_GUID = CTM_Base + 0x20
    };
    
    struct INISECTIONVALUE
    {
    	string scKey;
    	string scValue;
    };
    
    void ReadProcMem(void *pAddress, void *pMem, int iSize);
    void WriteProcMem(void *pAddress, void *pMem, int iSize);
    void LoadSetting();
    void IniGetSection(string scFile, string scApp, list<INISECTIONVALUE> &lstValues);
    float IniGetF(string scFile, string scApp, string scKey, float fDefault);
    unsigned long GetPid(char *procName);
    void CMOVE(float x,float y,float z,int Action);
    void Farm(float x,float y,float z,UINT64 obj);
    float distance(float x, float y, float z, float dx, float dy, float dz);
    main.cpp
    Code:
    #include "header.h"
    
    DWORD Pid;
    uint BaseAddress;
    float mx,my,mz,rot;
    float Dist;
    HWND hwnd;
    list<INISECTIONVALUE> lstOBJ;
    list<INISECTIONVALUE> lstBlist;
    
    int main(int argc, char* argv[])
    {
    	LoadSetting();
    	while(true)
    	{
    	    uint ObjectPointer;
    	    ReadProcMem((LPVOID)(CurMgrPointer),&ObjectPointer,4);
    	    ReadProcMem((LPVOID)(ObjectPointer + CurMgrOffset),&ObjectPointer,4);
    		UINT64 me;
    	    ReadProcMem((LPVOID)(ObjectPointer + LocalGUID),&me, 8);
    	    ReadProcMem((LPVOID)(ObjectPointer + FirstObject),&ObjectPointer,4);
    	    while (ObjectPointer != 0 && ObjectPointer % 2 == 0)
    	    {
    			UINT64 cobj;
    		    ReadProcMem((LPVOID)(ObjectPointer + 0x30),&cobj, 8);
    		    if(me == cobj)
    		    {
    			    ReadProcMem((LPVOID)(ObjectPointer + Pos_X),&mx, 4);
    			    ReadProcMem((LPVOID)(ObjectPointer + Pos_Y),&my, 4);
    			    ReadProcMem((LPVOID)(ObjectPointer + Pos_Z),&mz, 4);
    		    }
    			uint ob;
    			char obname[256]="";
    			float ox,oy,oz;
    		    ReadProcMem((LPVOID)(ObjectPointer + ObjectName1),&ob, 4);
                ReadProcMem((LPVOID)(ob + ObjectName2),&ob, 4);
                ReadProcMem((LPVOID)(ob),&obname[0], 100*sizeof(char));
    			ReadProcMem((LPVOID)(ObjectPointer + GameObjectX),&ox, 4);
    			ReadProcMem((LPVOID)(ObjectPointer + GameObjectY),&oy, 4);
    			ReadProcMem((LPVOID)(ObjectPointer + GameObjectZ),&oz, 4);
    			bool blist=false;
    			foreach(lstBlist, INISECTIONVALUE,lst)
    			{
    				char buffer [64];
    				sprintf(buffer,"%f %f %f",ox,oy,oz);
    				if(strcmp(buffer,lst->scKey.c_str())==0)
    					blist=true;
    			}
    			foreach(lstOBJ, INISECTIONVALUE,list)
    	        {
    		        if(strcmp(list->scKey.c_str() , obname)==0 && !blist)
    		        {
    					if(distance(ox,oy,oz,mx,my,mz) <= Dist)
    					{
    					    Farm(ox,oy,oz,cobj);
    					}
    				}
    			}
    			UINT64 target;
    			ReadProcMem((LPVOID)(CurrentTargetGUID),&target,8);
    			if(target>0)
    			{
    				float tx,ty,tz;
    				if(target == cobj)
    		        {
    			        ReadProcMem((LPVOID)(ObjectPointer + Pos_X),&tx, 4);
    			        ReadProcMem((LPVOID)(ObjectPointer + Pos_Y),&ty, 4);
    			        ReadProcMem((LPVOID)(ObjectPointer + Pos_Z),&tz, 4);
    					CMOVE(tx,ty,tz,WalkTo);
    					::PostMessage(hwnd, WM_KEYDOWN, VkKeyScan('1') , 0);
    	                ::PostMessage(hwnd, WM_KEYUP, VkKeyScan('1') , 0);
    					::PostMessage(hwnd, WM_KEYDOWN, VkKeyScan('2') , 0);
    	                ::PostMessage(hwnd, WM_KEYUP, VkKeyScan('2') , 0);
    		        }
    			}
    			ReadProcMem((LPVOID)(ObjectPointer + NextObject),&ObjectPointer,4);
    	    }
    	}
    }
    
    void CMOVE(float x,float y,float z,int Action)
    {
    	WriteProcMem((LPVOID)(CTM_X),&x, 4);
    	WriteProcMem((LPVOID)(CTM_Y),&y, 4);
    	WriteProcMem((LPVOID)(CTM_Z),&z, 4);
    	WriteProcMem((LPVOID)(CTM_Action),&Action, 4);
    }
    
    float distance(float x, float y, float z, float dx, float dy, float dz)
    {
    	float dist_x = x-dx;
    	float dist_y = y-dy;
    	float dist_z = z-dz;
        float dist = sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z);
        return dist;
    }
    
    void Farm(float x,float y,float z,UINT64 obj)
    {
    	CMOVE(x,y,z,WalkTo);
    	if(distance(x,y,z,mx,my,mz)<=6.0f)
    	{
    		printf("Farming %f %f %f\n",x,y,z);
    		CMOVE(x,y,z,Stop);
    		::PostMessage(hwnd, WM_KEYDOWN, VkKeyScan('2') , 0);
    	    ::PostMessage(hwnd, WM_KEYUP, VkKeyScan('2') , 0);
    	    Sleep(2000);
    	    WriteProcMem((LPVOID)(MouseOverGUID),&obj, 8);
    	    ::PostMessage(hwnd, WM_KEYDOWN, 0x08 , 0);
    	    ::PostMessage(hwnd, WM_KEYUP, 0x08 , 0);
    	    Sleep(5000);
    	    ::PostMessage(hwnd, WM_KEYDOWN, VkKeyScan('2') , 0);
    	    ::PostMessage(hwnd, WM_KEYUP, VkKeyScan('2') , 0);
    	    Sleep(2000);
    	    ::PostMessage(hwnd, WM_KEYDOWN, VK_SPACE , 0);
    	    Sleep(1000);
    	    ::PostMessage(hwnd, WM_KEYUP, VK_SPACE , 0);
    	}
    }
    void LoadSetting()
    {
    	string set_scFarmFile;
        char szCurDir[MAX_PATH];
        GetCurrentDirectory(sizeof(szCurDir), szCurDir);
        set_scFarmFile = string(szCurDir) + "\\farm.ini";
    	IniGetSection(set_scFarmFile, "Node", lstOBJ);
    	IniGetSection(set_scFarmFile, "BadNode", lstBlist);
    	Dist = IniGetF(set_scFarmFile, "DetectRange", "range",50.0f);
    	Pid = GetPid("Wow.exe");
    	hwnd = ::FindWindow(NULL,"World of Warcraft");
    }
    
    void ReadProcMem(void *pAddress, void *pMem, int iSize)
    {
    	HANDLE hProc = OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_WRITE|PROCESS_VM_READ, FALSE, Pid);
    	DWORD dwOld;
    	VirtualProtectEx(hProc, pAddress, iSize, PAGE_EXECUTE_READWRITE, &dwOld);
    	ReadProcessMemory(hProc, pAddress, pMem, iSize, 0);
    	CloseHandle(hProc);
    }
    
    void WriteProcMem(void *pAddress, void *pMem, int iSize)
    {
    	HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Pid);
    	DWORD dwOld;
    	VirtualProtectEx(hProc, pAddress, iSize, PAGE_EXECUTE_READWRITE, &dwOld);
    	WriteProcessMemory(hProc, pAddress, pMem, iSize, 0);
    	CloseHandle(hProc);
    }
    
    void IniGetSection(string scFile, string scApp, list<INISECTIONVALUE> &lstValues)
    {
    	lstValues.clear();
    	char szBuf[0xFFFF];
    	GetPrivateProfileSection(scApp.c_str(), szBuf, sizeof(szBuf), scFile.c_str());
    	char *szNext = szBuf;
    	while(strlen(szNext) > 0)
    	{
    		INISECTIONVALUE isv;
    		char szKey[0xFFFF] = "";
    		char szValue[0xFFFF] = "";
    		sscanf(szNext, "%[^=]=%[^\n]", szKey, szValue);
    		isv.scKey = szKey;
    		isv.scValue = szValue;
    		lstValues.push_back(isv);
    		szNext += strlen(szNext) + 1;
    	}
    }
    
    float IniGetF(string scFile, string scApp, string scKey, float fDefault)
    {
    	char szRet[2048];
    	char szDefault[16];
    	sprintf(szDefault, "%f", fDefault);
    	GetPrivateProfileString(scApp.c_str(), scKey.c_str(), szDefault, szRet, sizeof(szRet), scFile.c_str());
    	return (float)atof(szRet);
    }
    
    unsigned long GetPid(char *procName)
    {
       PROCESSENTRY32 pe;
       HANDLE thSnapshot;
       BOOL retval, ProcFound = false;
       thSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
       if(thSnapshot == INVALID_HANDLE_VALUE)
       {
          MessageBox(NULL, "Error: unable to create toolhelp snapshot","Error", NULL);
          return false;
       }
       pe.dwSize = sizeof(PROCESSENTRY32);
       retval = Process32First(thSnapshot, &pe);
       while(retval)
       {
          if(strcmp(pe.szExeFile, procName) == 0)
          {
             ProcFound = true;
             break;
          }
          retval    = Process32Next(thSnapshot,&pe);
          pe.dwSize = sizeof(PROCESSENTRY32);
       }
       if (!ProcFound) return 0;
       return pe.th32ProcessID;
    }
    make a new text file call it Farm.ini edit it and add

    [DetectRange]
    range=100.0
    [Node]
    Khorium Vein
    Peacebloom
    Earthroot
    Silverleaf
    [BadNode]
    2200.010010 -92.000000 21.225000

    its just a test no dought it can be better
    Last edited by kosacid; 09-01-2012 at 05:10 AM.

  10. #10
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well nice to share it, but you know pythagoras, do you? Was a pretty intelligent guy and with his help will you be able to calculate the distance without your messy method

  11. #11
    kosacid's Avatar Active Member
    Reputation
    19
    Join Date
    May 2009
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ye i know i need to find anothere way it was just a quick fix to get the distance to target not looked into that part yet, i used it in my nav bot but that just needs a rough guide when its has reached its point

  12. #12
    reliasn's Avatar Legendary Authenticator enabled
    Reputation
    774
    Join Date
    Jan 2009
    Posts
    136
    Thanks G/R
    24/215
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just passing by to say that I also didn't manage to loot properly with CTM. If my bot is stopped and I target a dead mob I just killed and run my function that does the looting with 0x6 (tried with 0x7 aswell), it works just fine, my bot goes there and loots the mob.

    However, when it is actually running a profile, farming mobs, for example, after killing a mob, it just won't loot with the same exact function. Only if I "move a little" like DarkLinux said.

    So yeah, I'm just writing in the MouseOverGUID and sending an Interact with MouseOver key. You could do the same with LastTarget.

  13. #13
    kosacid's Avatar Active Member
    Reputation
    19
    Join Date
    May 2009
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok fixed the range detection also added a few othere bits that i needed
    basicly make a kill macro up and place it in slot 1 and put your mount icon in slot 2 i also had to add bad nodes list so the ini looks like this now

    Farm.ini

    [DetectRange]
    range=100.0
    [Node]
    Khorium Vein
    Peacebloom
    Earthroot
    Silverleaf
    [BadNode]
    2200.010010 -92.000000 21.225000

    you add the bad nodes by looking at the last visited node in the list
    i have a nav bot so i use that to fly around this was a sort of addon to it
    Last edited by kosacid; 08-31-2012 at 07:16 PM.

Similar Threads

  1. Cant auto loot bop items from mobs with the bot please help
    By lockdogone in forum WoW Bots Questions & Requests
    Replies: 3
    Last Post: 12-16-2012, 04:00 AM
  2. [need help] Glider wont auto loot
    By grond in forum World of Warcraft General
    Replies: 0
    Last Post: 03-16-2008, 03:13 PM
  3. + rep 4 some1 how helps me with ce prob
    By kirby12 in forum World of Warcraft General
    Replies: 2
    Last Post: 06-01-2007, 06:04 PM
  4. Help with Auto-it!!
    By Krazzee in forum World of Warcraft General
    Replies: 7
    Last Post: 06-12-2006, 09:22 PM
All times are GMT -5. The time now is 12:58 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search