Craft Festival Waypoints

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.
Message
Author
kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Craft Festival Waypoints

#1 Post by kenzu38 » Sun Jul 14, 2013 8:55 pm

First of all, credits to lisa for posting the original code.

I just expanded it, put more features into it when I was using the original script for leveling my own chars' crafting skills.

ATTENTION: There's a new version 3.2beta available for download which should make the script work in all languages and should fix the error in buying ingredients.

Added Features:

- Auto-buys and learns the needed recipes at the start of the script if it detects you still haven't learned them.

- There is a user options part of the script so you can tweak several stuff there.

- You can set how many ingredients to buy every time it opens the store in the user options.

- Auto-sells the items you have crafted whenever you buy new ingredients from the store to keep your bag from filling up by default. You can turn it off in the user options.

- If you're almost at a level where you need to raise the Max Skill level or where you need to change recipes, the script auto-adjusts how much ingredients to buy. This is useful so you don't buy too much ingredients and keep on crafting without getting any exp.

- Prints some useful info on the MM Window and MM Window name. You can choose to print all available info or only the bare minimum in the user options.

- The script will pause and remind you of your total available backpack space and your total gold every time you start it. Just press Delete to resume. If you find this feature annoying, you can turn it off in the user options.


Notes:

Code: Select all

1.) Further explanation of the multipliers you see in the user options: 

Let's say for example, you set your multiplier to 500 and then let's say the item you are crafting needs 3 x item A, 1 x item B and 1 x of item C. The multiplier will not just buy 500 x of item A, since you need 3 x of item A to craft one item, the multiplier will buy 3 x multiplier of item A. In short, it buys 1500 units of item A.

Also, consider that the game requires at least 2 empty bag spaces for you to craft multiple items successfully. Setting up the multiplier so that it leaves you exactly with 1 empty bag space after buying the ingredients  will still stop the script from working properly.

So take this into consideration when tweaking multipliers.

2.) I recommend you don't tweak the first two multiplier options since they already work well without tweaking. As for the Level 50 and above multiplier, you can tweak it to whatever you like depending on your bag space. Probably up to 1500 is safe and good. Making this number too high will make the checks I put in the code ineffective.

3.) You will need probably around 20M gold if you are leveling from 15 to 75. And depending on your multiplier settings, you will need a considerable amount of bag space. That's why I made the script remind you of these things by default. Again, if you find it annoying, you can turn it off in the user options.

4.) The script will error if your crafting level is below 15 or level 75 and above.

5.) The calculations for Exp/Min, ETA etc are very basic and relies solely on the standard casting time for crafting an item of 5 seconds. If you are using a crafting speed skill, then the Exp/Min and ETA displayed will be way off.

6.) If all goes as intended, this should be a set-it-and-forget-it script.
The Zip File attached contains 5 waypoint files. One for every crafting skill. Note that they will only work for servers with UNfixed recipe vendors.

Just post here any errors you encounter and I'll see what I can do about it.

Changelog:

Code: Select all

V 2.0 Changelog:
1.) Fixed error in calculating the craftstnl variable which pretty much broke the auto-adjust of items to buy feature of the script.

2.) Found out that store:buyItem still buys 1 item even if the variable was 0. So had to fix this too.

3.) Put a default value for expgained variable if it is 0.


V 2.1 Changelog:
1.) Fixed a copy paste error at line 104 of the Tailoring script. The if statement was missing an end. 


V 2.2b Changelog
1.) All files now integrated to a single file.

2.) User is asked to input which skill to level upon starting the script. This is turned on by default, you can turn this off and set which skill you like to level in the user options.

3.) You can now set in the user options what level you'd like the bot to stop at and set what you want the bot to do after reaching that level. 

4.) Script now checks first if you are near the Event NPCs and will give an error if you're not. It will also go to where the tools are at automatically if it detects you are pretty far from it.

5.) Added support for item-set skills (still in Beta as I do not have these skills and could not fully test it, so testers are needed). Once again, credits go to lisa for the functions needed to add support for these skills. 

6.) Added support for production speed potion - 1 day. The bot will auto-use it at the start of the script if user option is set to do that. If anyone has the 7 and 30 day potions, just post the Buff ids here so I can add support for them.

7.) Added a user option yrestadjustment for you to tweak the timing of the prints and the getting of info. If you are notcing the prints come BEFORE the char finishes casting, you will have to tweak it and make it so that the prints come a little AFTER the char finishes casting. This helps the bot to calculate some needed values accurately.


V 2.3b Changelog
1.) Fixed an error in the code that detects if the char has the crafting item set skills.

2.) yrestadjustment value is explained better in this version. Make sure you tweak this value well.


V 3.0b Changelog
1.) Fixed an error in the buyItems function.

2.) Changed learnRecipes function to cope with the fixed NPC recipe vendors.


V 3.1b Changelog
1.) Should now support all languages.

2.) Added function clearStoreInfo to force store to update items.

3.) A handful of minor tweaks.


V 3.2b Changelog
1.) Fixed player:getCraftLevel() error for non-EN versions..

2.) Some more minor tweaks.
Attachments
CraftFestival(ForFixedNPCs).xml
- version 3.2 beta
- fixed player:getCraftLevel() error for non-EN versions.
(22.32 KiB) Downloaded 299 times
CraftFestival.xml
- version 2.3 beta
- fixed error in the charHasItemSetSkill function
(21.71 KiB) Downloaded 376 times
CraftFestivalv21.zip
- version 2.1
- fixed a copy paste error in the Tailoring script.
(14.88 KiB) Downloaded 352 times
Last edited by kenzu38 on Tue Jun 28, 2016 2:12 pm, edited 16 times in total.

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

Re: Craft Festival Waypoints

#2 Post by rock5 » Mon Jul 15, 2013 12:18 am

Good work. Nice neat coding. Easy to follow. I like it.

I was just thinking, there is a lot of duplicated code there. Maybe you could put the duplicated code into a separate file that is used by all of them. Either a userfunction or a separate lua that is called by each, eg. include("craftfunctions.lua"). It's useful for a number of reasons. If you get an error in an lua file it tells you which line it's on so you can fix it, xmls don't. If there is a bug in a common function you only need to fix it in one place instead of 5. It's just an idea.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Craft Festival Waypoints

#3 Post by lisa » Mon Jul 15, 2013 1:35 am

My 2 cents, I would have looked at making it just 1 WP and have user input when it starts to determine which craft to lvl up. Just use different tables for each craft but that is just me ;)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Craft Festival Waypoints

#4 Post by kenzu38 » Mon Jul 15, 2013 2:46 am

rock5 wrote:Good work. Nice neat coding. Easy to follow. I like it.
Thanks. Glad you find it neat. That's exactly what I was aiming for. I wanted this script to be easily understood by even the ones new to coding so they have a high chance of fixing or customizing some of the things in the script themselves.
rock5 wrote:I was just thinking, there is a lot of duplicated code there. Maybe you could put the duplicated code into a separate file that is used by all of them. Either a userfunction or a separate lua that is called by each, eg. include("craftfunctions.lua").
Thanks for the suggestion, nice idea. It's like what you did in survival script. I just have one question though, if people put them on separate folders, would the lua file still be detected by the waypoint?
rock5 wrote:It's useful for a number of reasons. If you get an error in an lua file it tells you which line it's on so you can fix it, xmls don't.
Yep, read about this long ago and ever since, I've been doing this to check for errors in functions I write.
lisa wrote:My 2 cents, I would have looked at making it just 1 WP and have user input when it starts to determine which craft to lvl up. Just use different tables for each craft but that is just me
I actually thought about this but I also thought that maybe more people are like me who would like to chain this wp to another one, coz that's what I did for a few days since it takes several days to level to 75 if you can't bot 24/7. I made my chars craft after doing all their dailies.

Making it wait for user input would cause the chain to stop and so I just opted to release it like this.

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Craft Festival Waypoints

#5 Post by Ego95 » Mon Jul 15, 2013 4:50 am

Really nice script. It works great and I think there is nothing to improve. I did 3 level of tailoring this morning. But when I came back mm had stopped with the error

Code: Select all

Current Tailoring Level is 68 and 92.28%
Did not find any crashed game clients.
9:27am - [string "..."]:228: attempt to concatenate local 'craftableamount' (a n
il value)
What's this?

AlterEgo95

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

Re: Craft Festival Waypoints

#6 Post by rock5 » Mon Jul 15, 2013 6:38 am

kenzu38 wrote:I just have one question though, if people put them on separate folders, would the lua file still be detected by the waypoint?
I implemented relative folder support a little while ago, for both loadPaths and include. So as long as the files are moved together it should find it.
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Craft Festival Waypoints

#7 Post by kenzu38 » Mon Jul 15, 2013 7:24 am

I implemented relative folder support a little while ago, for both loadPaths and include. So as long as the files are moved together it should find it.
Ok, thanks for the info. I'll have a look at your survival script later.
AlterEgo95 wrote:Really nice script. It works great and I think there is nothing to improve. I did 3 level of tailoring this morning. But when I came back mm had stopped with the error

Code: Select all

Current Tailoring Level is 68 and 92.28%
Did not find any crashed game clients.
9:27am - [string "..."]:228: attempt to concatenate local 'craftableamount' (a n
il value)
What's this?

AlterEgo95
Hey there.Thanks for the compliment.

That error means it couldn't get the value of the craftableamount variable when it tried to print it on your MM window name.

I think the reason the value was nil is you lagged or disconnected from the game right when it was trying to print that value.

Although, if it keeps happening to you, just report it here so I can investigate further.


Btw guyz, just a heads up to those who have downloaded, I'm sorry but I found a problem with version 1. Though, it only concerns those who start the bot when they're at levels 19, 24, 34, 39, 44, 54, 59, 64 and 74. It's a pretty minor inconvenience if you didn't set the multipliers too high.

I will post a fix later though when I tested some things a bit further.

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Craft Festival Waypoints

#8 Post by Ego95 » Tue Jul 16, 2013 12:51 am

Ok, I think it was really a problem of my computer, I had 7 clients running. Last night this great script took me from level 68 to 74 :)
I found one thing, which would be nice to use.

There are two setskills that push up your crafting speed and your crafting experience:

Crafting experience: http://www.runesdatabase.com/itemset/61 ... ardian-set
Crafting speed: http://www.runesdatabase.com/itemset/610268

It would be nice to let the bot use these setskills if they are aviable. Of course not everyone has those skills, but maybe you could set it to true or false in the onLoad if you have got them or not.


AlterEgo95

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Craft Festival Waypoints

#9 Post by lisa » Tue Jul 16, 2013 1:15 am

GetIdName(495777) and GetIdName(495776)
could just add in a check for the skill is available and on cooldown or not and if not on cooldown then use it, so if people don't have the skill it shouldn't do anything but if you do have the skill it would use it automatically.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Craft Festival Waypoints

#10 Post by kenzu38 » Tue Jul 16, 2013 2:12 am

AlterEgo95 wrote:Ok, I think it was really a problem of my computer, I had 7 clients running. Last night this great script took me from level 68 to 74 :)
I found one thing, which would be nice to use.

There are two setskills that push up your crafting speed and your crafting experience:

Crafting experience: http://www.runesdatabase.com/itemset/61 ... ardian-set
Crafting speed: http://www.runesdatabase.com/itemset/610268

It would be nice to let the bot use these setskills if they are aviable. Of course not everyone has those skills, but maybe you could set it to true or false in the onLoad if you have got them or not.


AlterEgo95
First of all, please download the new version of the script as I found the way it calculates some stuff is faulty. Fixed it with the new version.

Sure, I'd look into adding that. Probably this weekend though, I don't have much free time on weekdays.

I was thinking of tidying the code a bit more like rock suggested but found out it will actually take me some time to do all that so I decided to just release the fix first and worry about that when I have more free time.

thomasmcman
Posts: 1
Joined: Tue Jul 16, 2013 10:26 am

Re: Craft Festival Waypoints

#11 Post by thomasmcman » Tue Jul 16, 2013 10:29 am

Hi guys. I'm new here so first I'd love to say thank you for all the help you guys have given my RoM characters over the years via this site. Also, quick question about this waypoint file. Where should I start? In Dalanis? I've never done the crafting festival before. Is there no cooking one?

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Craft Festival Waypoints

#12 Post by lolita » Tue Jul 16, 2013 6:31 pm

i guess you should start it on varanas central plaza, near crafting event NPC.
dont know exactly we still have music festival :D
Life is a journey, not destination :D

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Craft Festival Waypoints

#13 Post by kenzu38 » Wed Jul 17, 2013 2:05 am

Hi guys. I'm new here so first I'd love to say thank you for all the help you guys have given my RoM characters over the years via this site. Also, quick question about this waypoint file. Where should I start? In Dalanis? I've never done the crafting festival before. Is there no cooking one?
If Crafting Festival is ongoing in your server, then, you can start these scripts near the NPCs named Fiona (for Alchemy and Tailoring) and Mizner (for the other craft skills). They should be present in Varanas Central Plaza at the back of the big fountain.

And no, unfortunately, the game didn't include cooking for this event.


@AlterEgo95

I'm doing the code you suggested. I'll need the Buff Ids for these skills though. So if you post them here, I can begin adding this to the script.

wiedzmin97
Posts: 44
Joined: Wed Jul 03, 2013 1:37 pm

Re: Craft Festival Waypoints

#14 Post by wiedzmin97 » Wed Jul 17, 2013 5:25 am

Hi i have problem, when i running the waypoint CraftFestivalTailoring, it show me :

Code: Select all

You chose 5
Loaded waypoint path CraftFestivalTailoring.xml
No return path with default naming CraftFestivalTailoring_return.xml found.
We use the normal waypoint path CraftFestivalTailoring.xml now.
Did not find any crashed game clients.
12:24am - ...ownloads/rombot/scripts/rom/classes/waypointlist.lua:83: Failed to
compile and run Lua code for waypointlist onLoad event.
What is it? Something is wrong with this waypoint?

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Craft Festival Waypoints

#15 Post by kenzu38 » Wed Jul 17, 2013 7:17 am

wiedzmin97 wrote:Hi i have problem, when i running the waypoint CraftFestivalTailoring, it show me :

What is it? Something is wrong with this waypoint?
Yep, there was a copy paste error on my part. Fixed it now with version 2.1.

Sorry about that guyz. To those who have downloaded, if you don't want to download again just look at line 104 of the tailoring script and put an end to the if statement.

lisa wrote:GetIdName(495777) and GetIdName(495776)
could just add in a check for the skill is available and on cooldown or not and if not on cooldown then use it, so if people don't have the skill it shouldn't do anything but if you do have the skill it would use it automatically.
I'm working now on support for crafting item-set skills. Problem is, as far as I know, item-set skills aren't on skill books. So I don't know how to get the skills' cooldown. Do you have an idea how to do that?

krokin
Posts: 8
Joined: Sun Sep 23, 2012 2:23 pm

Re: Craft Festival Waypoints

#16 Post by krokin » Wed Jul 17, 2013 8:44 am

I don't know why, but without

Code: Select all

printallinfoonmmwindow
set to

Code: Select all

= true
the script won't buy any materials. Tried it with alchemy and tailoring.

Now it works great, though - thank you for sharing it :)

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Craft Festival Waypoints

#17 Post by kenzu38 » Fri Jul 19, 2013 2:45 am

the script won't buy any materials. Tried it with alchemy and tailoring.
Weird, tested both files just now upon reading this. Couldn't duplicate this problem. It always bought the items no matter the print setting I used.

Only thing I could think of is you probably used version 1 which was faulty.

Anyway, just let me know if you wanna troubleshoot it further.


Btw guyz, to those of you who have Crafting item-set skills, just post here the Buff ids and I'll try to add support for them.

It will not be a "full support", though, until I figure out how to get their cooldown.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Craft Festival Waypoints

#18 Post by lisa » Fri Jul 19, 2013 3:49 am

I have always concidered easier ways to make the skill info well easier, atm basically you need it to be in the profile to get added or you can't make a class out of it, well not completely, you can get some info but not really all.

I could be wrong, rock would know that part of things better than me.

You can add a function to your WP for now though and have it look like this.

Code: Select all

function getCD(ID)
	local offset = memoryReadRepeat("int", getProc(), GetItemAddress(ID) + addresses.skillRemainingCooldown_offset) or 0
	if offset and offset ~= 0 then
		return (memoryReadRepeat("int", getProc(), addresses.staticCooldownsBase + (offset+1)*4) or 0)/10
	end
	return 0
end
Then just use

getCD(495777)
getCD(495776)

Which of course works, even for set skills

Code: Select all

Command> print(getCD(490300))
114
Command> print(getCD(495478))
56.4
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

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

Re: Craft Festival Waypoints

#19 Post by rock5 » Fri Jul 19, 2013 4:23 am

Yes, I included a function to get basic skills data called FindSkillBookSkill() but it has it's limitations. It returns a lot of skill values but is not based on the skill class so it doesn't inherit the skills class functions such as "skill:getRemainingCooldown()". If I remember correctly it was too difficult to implement. Maybe I can add a getRemainingCooldown to the returned value from FindSkillBookSkill(). Maybe I can even add a basic "use()" function too so you can use the skill too without the need to add the skill to the profile. Although Lisas solution is simple and effective.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Craft Festival Waypoints

#20 Post by lisa » Fri Jul 19, 2013 4:55 am

rock5 wrote:I included a function to get basic skills data called FindSkillBookSkill() but it has it's limitations.
It doesn't cover set skills, I tried it first =)

Second thing I did was change the getcooldown function to accept an address argument and use that but I decided easiest was to just create new function in the WP.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests