flexike Posted October 12, 2017 Share Posted October 12, 2017 Hello, So I only making this topic, because I'm curious on other people's opinion. I just started to learn scripting like a week or so ago, but I didn't have too much time for it.. I've read a lot about it on this forum, and I think I learned a few things.. I think I've read all of the threads in the Snippets/Tutorials section, and I gotta say thank you to Explv and liverare because I learnt a lot about their stuff. I made my first script for myself, just for fun.. What it does is right after tutorial island, it's gonna start training first Fishing to lvl30, and when it's done, it's gonna change to WC (Tree & Oak) If both skill reached lvl30, the script stops. I tested it and works flawless. Can any scripter check my script, if you have some free time, please? https://github.com/drawax/AIO If you could tell me anything about how can I improve it, I'd really appreciate that. Thanks in advance guys. 2 Quote Link to comment Share on other sites More sharing options...
Runnwith Posted October 12, 2017 Share Posted October 12, 2017 Dude, good job if this is your first script. I can't write a half-decent script for life of me and you come in here with a task-basked script. I hope your adventures and endeavors go well. 1 Quote Link to comment Share on other sites More sharing options...
HunterRS Posted October 15, 2017 Share Posted October 15, 2017 @flexike Great script, a few pointers: 1. In the walkToShrimp task, in verify, might want to change <= to just <, it will never be equal anyways because of you if statement in your main but if in the future you want to change anything it might mess it up. 2. In the walkToShrimp task, in execute, might want to think about adding a sleep after the walking event (SleepUntill(() -> ShrimpSpot.contains(myPlayer()), 2000). Again, not necessary but better safe than sorry. 3. In LumbyFishShrimps task, in execute, I would suggest also checking if the fishing spot is within the fishing location. I would also suggest you look into the use of osBot filters. 4. In LumbyFishShrimps task, in execute, before you interact with the spot you might also want to check if it has that action you are trying to do. Again this is just to double check you got to the right place and you don't try to interact with the wrong spot. Filter<NPC> spotFilter = new Filter<NPC>(){ public boolean match(NPC npc){ return npc.getName().equalsIgnoreCase("Fishing spot") && npc.hasAction(fishingType) && fishingArea.contains(npc) && script.getMap().canReach(fishingSpot); } }; 5. In LumbyFishShrimps task, in execute, I dont see any reason to sleep until your inv is filled as you are not interacting with the spot if you player is animating anyways. In my opinion that sleep will only cause delay and problems. 6. In LumbyFishShrimps task, in execute, again look into filter for the fishing net, also interact and then sleep (it might spam click the pickup). if(fishingNet.interact("Take")){ Sleep.sleepUntil(() -> script.getInventory().contains("Small fishing net"), 2000); } 7.In DropTask, in execute, I would sleep untill inv is empty/only contains the net. 8. In WalkToTrees, in execute, again sleep for the walk. Same with the walkToOak 9. In OakWoodCutTask, in verify, again < and not <= with the finalWcLvl, right now it will train until the final level + 1. In execute, filters xD. 10. In TreeWoodCutTask, just filters 11. In AIO (main), pretty sure dismissing level up msgs is pretty useless as they will stop the animation anyways and once you interact again they will auto dismiss. A few tips: - Go over as much of the API as you possibly can. - Test your script logic with flow charts, make sure you get all of the end situations (Do them in your head like me if you can't, no one really writes them down outside of school ) - Test your script by running it for as long as possible with babysitting it. This will probably show you anything you missed . - Keep writing scripts because you are a great script writer. Over all, great script man. Looks like you are a natural . 2 Quote Link to comment Share on other sites More sharing options...