MountSpeedhack ( some code for userfunction addon)

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
User avatar
Bot_romka
Posts: 96
Joined: Tue Apr 05, 2011 2:59 am
Location: Russia

MountSpeedhack ( some code for userfunction addon)

#1 Post by Bot_romka » Mon Aug 29, 2011 12:08 pm

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
Last edited by Bot_romka on Mon Aug 29, 2011 2:26 pm, edited 1 time in total.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MountSpeedhack ( some code for userfunction addon)

#2 Post by rock5 » Mon Aug 29, 2011 12:57 pm

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.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Bot_romka
Posts: 96
Joined: Tue Apr 05, 2011 2:59 am
Location: Russia

Re: MountSpeedhack ( some code for userfunction addon)

#3 Post by Bot_romka » Mon Aug 29, 2011 1:17 pm

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>

User avatar
Bot_romka
Posts: 96
Joined: Tue Apr 05, 2011 2:59 am
Location: Russia

Re: MountSpeedhack ( some code for userfunction addon)

#4 Post by Bot_romka » Mon Aug 29, 2011 3:23 pm

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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MountSpeedhack ( some code for userfunction addon)

#5 Post by rock5 » Mon Aug 29, 2011 6:50 pm

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.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Bot_romka
Posts: 96
Joined: Tue Apr 05, 2011 2:59 am
Location: Russia

Re: MountSpeedhack ( some code for userfunction addon)

#6 Post by Bot_romka » Tue Sep 06, 2011 6:32 am

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
Attachments
userfunction_MountSpeedHack.lua
(2.12 KiB) Downloaded 375 times
Last edited by Bot_romka on Mon Sep 12, 2011 2:35 am, edited 1 time in total.

aspart
Posts: 42
Joined: Tue Jul 26, 2011 3:21 pm

Re: MountSpeedhack ( some code for userfunction addon)

#7 Post by aspart » Tue Sep 06, 2011 10:34 am

should make a macro to turn it on and off in game.

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: MountSpeedhack ( some code for userfunction addon)

#8 Post by kanta » Tue Sep 06, 2011 3:29 pm

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.
Scout/Knight/Rogue 70/66/66

User avatar
Bot_romka
Posts: 96
Joined: Tue Apr 05, 2011 2:59 am
Location: Russia

Re: MountSpeedhack ( some code for userfunction addon)

#9 Post by Bot_romka » Wed Sep 07, 2011 5:00 am

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
Attachments
MountSpeedhack.xml
(648 Bytes) Downloaded 354 times

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests