Page 1 of 1
Mount Up
Posted: Sat Jan 23, 2010 11:34 pm
by iam_clint
player.lua
Code: Select all
function CPlayer:Mount()
self:update();
cprintf(cli.green, "Checking mount status and mounting: %i\n", self.Mounted);
if (self.Mounted==1) then
keyboardRelease(settings.hotkeys.MOVE_FORWARD.key);
keyboardPress(_G.key.VK_MINUS);
yrest(6000);
end;
end
cplayer:update() function mod
Code: Select all
self.Mounted = debugAssert(memoryReadByte(getProc(), self.Address + addresses.pawnMount_offset), language[41]);
pawn.lua cpawn class
pawn.lua update
Code: Select all
self.Mounted = debugAssert(memoryReadByte(proc, self.Address + addresses.pawnMount_offset), memerrmsg);
addresses.lua
Thought I would share this, I did add it myself.
basicly in your waypoint file if you want it to hop on your mount because you know its a ways from town to fight anything
<!-- # 2 --><waypoint x="-13709" z="-450">player.Mount()</waypoint>
you can do something like this..
Re: Mount Up
Posted: Sun Jan 24, 2010 2:03 am
by Administrator
Good work. I'd like to add this to the bot. I played with it a bit, improving it slightly. For example, your mount function will only work if the user hotkeys their mount to VK_MINUS. Try this instead:
Code: Select all
function CPlayer:mount()
if( not inventory ) then
return;
end
local mount = inventory:getMount();
if( mount ) then
mount:use();
yrest(6000);
end
end
This should work with any
permanant mount.
Re: Mount Up
Posted: Sun Jan 24, 2010 7:17 am
by iam_clint
Administrator wrote:Good work. I'd like to add this to the bot. I played with it a bit, improving it slightly. For example, your mount function will only work if the user hotkeys their mount to VK_MINUS. Try this instead:
Code: Select all
function CPlayer:mount()
if( not inventory ) then
return;
end
local mount = inventory:getMount();
if( mount ) then
mount:use();
yrest(6000);
end
end
This should work with any
permanant mount.
Ahh nice improvement however you took the check out to see if you are on your mount already which at this point it would demount you... I have it popping you up on your mount after 30 seconds of not fighting for my personal script.
Re: Mount Up
Posted: Sun Jan 24, 2010 1:42 pm
by InadequateCoder
iam_clint wrote:Ahh nice improvement however you took the check out to see if you are on your mount already which at this point it would demount you... I have it popping you up on your mount after 30 seconds of not fighting for my personal script.
Clicking the mount again in RoM doesn't dismount you it just resummons the mount. Though I agree a check should be used as less excess casting mean less lag. That's why all my buffs and cooldown skills have checks for existing buffs and cooldowns. (I also hate seeing that scrolling red text in the center of the screen)
Seeing this makes me think I didn't do enough on the functions I'm writing XD. Well, I guess I'll just have to learn as I go.
Re: Mount Up
Posted: Sun Jan 24, 2010 2:46 pm
by iam_clint
InadequateCoder wrote:iam_clint wrote:Ahh nice improvement however you took the check out to see if you are on your mount already which at this point it would demount you... I have it popping you up on your mount after 30 seconds of not fighting for my personal script.
Clicking the mount again in RoM doesn't dismount you it just resummons the mount. Though I agree a check should be used as less excess casting mean less lag. That's why all my buffs and cooldown skills have checks for existing buffs and cooldowns. (I also hate seeing that scrolling red text in the center of the screen)
Seeing this makes me think I didn't do enough on the functions I'm writing XD. Well, I guess I'll just have to learn as I go.
When i click my mount while i'm on it it simply demounts and thats all it does but at any rate there should still be a check in it in my opinion
Re: Mount Up
Posted: Sun Jan 24, 2010 3:09 pm
by InadequateCoder
Wierd. All mine does is recast the mount buff. Which mount are you using? It sounds like it's acting like a world of warcraft mount

.
Re: Mount Up
Posted: Sun Jan 24, 2010 10:17 pm
by Administrator
I've just committed the changes. player:mount() will now check if you are mounted before casting. player.Mounted is also a now boolean; true when mounted, false when not.
Re: Mount Up
Posted: Thu Feb 11, 2010 12:04 pm
by freerom
And any way of using the mount for 1 day you got from the begining? Tnks.Tryed to use a code in my profile page like this for mounting.has no effect.
<onLevelup>
-- open giftbag and equipt content
openGiftbags1To10(player.Level);
--203571 the id for brown horse
inventory:useItem(203571);
</onLevelup>
Re: Mount Up
Posted: Mon Mar 08, 2010 2:35 am
by rock5
freerom wrote:And any way of using the mount for 1 day you got from the begining? Tnks.Tryed to use a code in my profile page like this for mounting.has no effect.
<onLevelup>
-- open giftbag and equipt content
openGiftbags1To10(player.Level);
--203571 the id for brown horse
inventory:useItem(203571);
</onLevelup>
Maybe you need to do an inventory:update() before trying to use the mount?
Anyway I use this, which doesn't need inventory update and you can even put the mount in the Item Shop Bag;
Code: Select all
sendMacro("UseItemByName('Brown Horse (1 Day)')"); yrest(7500);