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
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:
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:
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.
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.
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
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.
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);
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;