January 17, 201610 yr Hey guys new scripter here I was just wondering what is the correct command for executing a state if a player is within a certain area? hope that makes sense!Thanks in advance! Please move to scripting help! Sorry! Edited January 17, 201610 yr by Snorunt
January 17, 201610 yr Area Bank = new Area(x,y, x,y): If (Bank.contains(S.myPlayer()){ //do stuff } This is how I do it, sorry if syntax is off, I'm on my phone
January 17, 201610 yr http://pastebin.com/RjMwwdMF Anybody got any ideas on whats up in this? It would help if you also mentioned what you are expecting this piece of code to do for you. From me looking at it, it looks like it probably will activate the "Start" state, but it doesnt seem that you've defined what the start state does yet, only the conditions which initiate it. So because you haven't really made the start state anywhere the script technically won't do anything yet. I recommend that you download some scripts in the downloadable section, decompile the .jar with JD GUI (http://jd.benow.ca/) and see how other people write their scripts. I personally write my scripts using nodes instead of states, I'm still new at java so I'm not so sure of the difference, other than it being a little bit more optimized because you're doing things in actual object oriented programming instead of having most of your lines of code in one .java. If you want an example of a node based script you could compile and learn from, click my signature for ikkWarriors, that's decompilable
January 17, 201610 yr http://osbot.org/forum/topic/58775-a-beginners-guide-to-writing-osbot-scripts-where-to-get-started-by-apaec/ check this out too.
January 18, 201610 yr Author I was trying to go off of that tutorial Guys thanks so much for your help! Really great community!
January 18, 201610 yr Author So its running, but it is spam clicking the npc; I tried adding a wait but its just going far too fast, any way to make it stop clicking when a dialogue box opens? Edited January 18, 201610 yr by Snorunt
January 18, 201610 yr you could use conditionalsleep Example; This will sleep for 500 if condition is true (which is if the specific widget is not visible.) new ConditionalSleep(500) { @Override public boolean condition() throws InterruptedException { return !getWidgets().isVisible(parent,child); } }.sleep(); Edited January 18, 201610 yr by Assnerd
January 18, 201610 yr Author Do you have Skype so you could TV me and explain? also check my code if possible. If you dont have time its cool Snoruntaioservices is my Skype if anybody wouldnt mind answering a couple of questions ! Edited January 18, 201610 yr by Snorunt
Create an account or sign in to comment