Page 1 of 1

Functions for auto use of 30 Day Mounts (From AT Minigame)

Posted: Thu May 21, 2015 7:47 am
by noobbotter
UPDATED: Version 1.1

This update will now use item ID for the horse rental tickets. Also fixed it so it will look for at least 1 in inventory (when needed) instead of more than 1.

I have some functions I use in my bots' daily scripts for mounting that utilize the 30 Day mounts, and creates new ones when needed so I thought I'd share it. I made this so I wouldn't have to manually go in to each bot every 30 days to build their 30 Day Mount, and it also removes my need for constantly worrying about sending horse rental tickets to them all.

I made this as a userfunction so if you add this file to your userfunctions directory, then all you have to do is any time you want your bot to mount, type "doMount()

doMount() will first check if the player is already mounted. If not, it will then check for a mount in inventory. If one is found, it will mount. If no mount is found in inventory, it will check inventory for both the Abysmal and Infernal mounts. If found, it will mount up. If not found, it will then check inventory for the items needed to create one. It will first check for Abysmal and if all needed items are found, it will create the mount. If not, it will then check for the items for an Infernal, and if found will create that one. Afterward, if there is still no mount it will check for any horse rental tickets and use one if found. At the end, after mounting, it will apply the speed() function.


***NOTE: the items required to create the 30 Day Mounts must be in the bot's bag inventory (not the bank) for this to create the 30 day mount when needed. If your bot does AT regularly and has all items needed to create both mounts, that uses 11 bag slots.

If you have any questions about this, feel free to ask here. I know my code may not be optimized, but it works and saves me a lot of time from worrying about if my bot has a mount or not.

Re: Functions for auto use of 30 Day Mounts (From AT Minigam

Posted: Thu May 21, 2015 12:06 pm
by rock5
Why not just take the extra step and make a userfunctions file? Just put those functions in file, call it userfunction_yourname.lua then post it.

Edit: Glancing over it I just noticed a bug.

Code: Select all

				check30daymounts()
				--after running function above, if it has or created a mount, havemount will now be "yes"
				if havemount == "no" then
havemount is a local variable in check30daymounts. It has no value in doMount. You run the check30daymounts function but don't accept the returned value. You could just change it to

Code: Select all

local havemount = check30daymounts()
or make havemount a global variable.

Re: Functions for auto use of 30 Day Mounts (From AT Minigam

Posted: Thu May 21, 2015 1:01 pm
by noobbotter
Oh, interesting. Didn't think about that. Well, I could jsut combine both functions into one. Maybe I'll do it that way, then repost it, as well as make a userfunction version and post that as well. Thanks Rock5.

*** Update: Edited the functions, made it all a single userfunction and edited first post.

Re: Functions for auto use of 30 Day Mounts (From AT Minigam

Posted: Tue Jun 02, 2015 9:05 am
by Celesteria
please use the item-ids for "horse rental ticket" which are 205821 and 203033

Re: Functions for auto use of 30 Day Mounts (From AT Minigam

Posted: Tue Jun 02, 2015 12:04 pm
by noobbotter
Good idea Celesteria. I updated it with the item ID's and I also noticed I had that part set for if there was more than 1 in inventory. I corrected that to be it there is 1 or more in inventory...

i updated the first post with the new version (1.1) and the changes.

Thank you.