Page 1 of 1

MountSpeedhack ( some code for userfunction addon)

Posted: Mon Aug 29, 2011 12:08 pm
by Bot_romka
MountSpeedhack ( some code for userfunction addon)

I have a problem in code. When Player not mounted and Bot enable function setMountSpeed(speed) or MountSpeedoff() then Bot permanent stoped.
Anyone if you have idea halp with this problem.

_sory for my bad english.

Code: Select all

------------setMountSpeed function-- Use setMountSpeed(100.0); to set MountSpeed = 100, normal speed is 82. Use MountSpeedoff(); to DEactivate.

function setMountSpeed(speed)
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
		if mount ~= 0 then
			memoryWriteFloat(getProc(), mount + 0x40, speed);
			printf("MountSpeedhack ACTIVATED!\n");
			local MountSpeed = memoryReadFloat(getProc(), mount + 0x40);
			print("MountSpeed:", MountSpeed);
		else
			RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cfffff00Userfunction_cheats: Can't set MountSpeed: player not Mounted.|r')")
			cprintf(cli.red, "Can't set MountSpeed: player not Mounted");
		end
	end
end

function MountSpeedoff()
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
		if mount ~= 0 then
			memoryWriteFloat(getProc(), mount + 0x40, 82);
			printf("MountSpeedhack DEactivated.\n");
			local MountSpeed = memoryReadFloat(getProc(), mount + 0x40);
			print("MountSpeed:", MountSpeed);
		else
			RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cfffff00Userfunction_cheats: Player not Mounted. MountSpeed is normal.|r')")
			cprintf(cli.red, "Player not Mounted. MountSpeed is normal.");
		end
	end
end

function getMountSpeed()
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
		if mount ~= 0 then
			local MountSpeed = memoryReadFloat(getProc(), mount + 0x40);
			print("MountSpeed:", MountSpeed);
			return MountSpeed
		else
			RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cfffff00Userfunction_cheats:Can't set MountSpeed: player not Mounted.|r')")
			cprintf(cli.red, "Can't set MountSpeed: player not Mounted");
			return nil; 
		end
	else
		cprintf(cli.red, "Can't set MountSpeed: playerAddress = nil");
		return nil; 
	end
end

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Mon Aug 29, 2011 12:57 pm
by rock5
If it is erroring, you should get an error message. If it is not erroring, it is just stopping, then it is probably stuck in a loop. There are no loops in the functions you provided so it must be a loop somewhere else.

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Mon Aug 29, 2011 1:17 pm
by Bot_romka
Problem in code function setMountSpeed(speed) and MountSpeedoff(). I used simle WP for test. If player mounted code worked fine, else if player not mounted Bot stoped without error or any mesage.

Code: Select all

<waypoints><!-- Test  -->

	<onLoad>
	repeat
		setMountSpeed(100)
		yrest(1500)
		while not keyPressedLocal(key.VK_CONTROL) do yrest(100); end;
		
		MountSpeedoff()
		yrest(1500)
		while not keyPressedLocal(key.VK_CONTROL) do yrest(100); end;
	until  false
	</onLoad>
</waypoints>

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Mon Aug 29, 2011 3:23 pm
by Bot_romka
Error only in code where checking player Mounted or not/

Code: Select all

      local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
      if mount ~= 0 then

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Mon Aug 29, 2011 6:50 pm
by rock5
Bot_romka wrote:Error only in code where checking player Mounted or not/

Code: Select all

      local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
      if mount ~= 0 then
That code doesn't check if your mounted, it checks the address for the mount. It looks like it should still work.
Bot_romka wrote:Problem in code function setMountSpeed(speed) and MountSpeedoff(). I used simle WP for test. If player mounted code worked fine, else if player not mounted Bot stoped without error or any mesage.
The problem is the can't. You can fix it 2 ways. You can change it to \\'. But I recomend you do it like this instead, it's less confusing. Whenever you need to use quotes in a string dont use ' but use \" instead. So it becomes.

Code: Select all

RoMScript("DEFAULT_CHAT_FRAME:AddMessage(\"|cfffff00Userfunction_cheats:Can't set MountSpeed: player not Mounted.|r\")")
Change it in both places and it should work.

Next time look for the error message in game. It's a redish dot with a flashing green border near the minimap. It will appear when you get an in game error.

By the way, it works nice.

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Tue Sep 06, 2011 6:32 am
by Bot_romka
Final code.

Use MountSpeedHack(); to set MountSpeed = 99, normal speed is 82.
Use MountSpeedoff(); to DEactivate hack.

With Mountspeed more then 99 player can run 10-30 seconds what is not useful.

userfunction addon in attachment.

Code: Select all

------------MountSpeed function-- Use MountSpeedHack(); to set MountSpeed = 99, normal speed is 82. Use MountSpeedoff(); to DEactivate.
function memoryfreezeMountSpeed()
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
		if mount ~= 0 then
			memoryWriteFloat(getProc(), mount + 0x40, 99);
		end
	end
end

function MountSpeedHack()
	registerTimer("MountSpeed", 10, memoryfreezeMountSpeed);
	printf("MountSpeedHack ACTIVATED!\n"); yrest(500);
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
		if mount ~= 0 then
			local MountSpeed = memoryReadFloat(getProc(), mount + 0x40);
			print("MountSpeed:", MountSpeed);
		end
	end
end

function MountSpeedoff()
	unregisterTimer("MountSpeed");
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
		if mount ~= 0 then
			memoryWriteFloat(getProc(), mount + 0x40, 82);
			printf("MountSpeedhack DEactivated.\n");
			local MountSpeed = memoryReadFloat(getProc(), mount + 0x40);
			print("MountSpeed:", MountSpeed);
		else
			print("Player not Mounted. MountSpeed is normal.");
		end
	end
end

function getMountSpeed()
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		local mount = memoryReadInt(getProc(), playerAddress + addresses.charPtrMounted_offset);
		if mount ~= 0 then
			local MountSpeed = memoryReadFloat(getProc(), mount + 0x40);
			print("MountSpeed:", MountSpeed);
			return MountSpeed
		else
			print("Can't set MountSpeed: player not Mounted");
			return nil;
		end
	else
		print("Can't set MountSpeed: playerAddress = nil");
		return nil;
	end
end

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Tue Sep 06, 2011 10:34 am
by aspart
should make a macro to turn it on and off in game.

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Tue Sep 06, 2011 3:29 pm
by kanta
aspart wrote:should make a macro to turn it on and off in game.
This isn't a hack like Romeo's. This is code to be used in the bot waypoints.

Re: MountSpeedhack ( some code for userfunction addon)

Posted: Wed Sep 07, 2011 5:00 am
by Bot_romka
For use MountSpeedhack in game instal userfunction_MountSpeedHack to Bot and run this waypoint. For activate or deactivate hack in game use Control key. In waypoint you can change key to anoder virtual key http://msdn.microsoft.com/en-us/library/ms927178.aspx