Jump to content

slimy

Members
  • Posts

    7
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

slimy's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. public long startTime; public long announceofferTime; public long tradeTime; public int onLoop() throws InterruptedException { startTime = System.currentTimeMillis(); announceofferTime = System.currentTimeMillis(); if (!getInventory().isEmpty()) { if (getBank().open()) { if (getBank().depositAll()) { if (getBank().close()) {} } else { if (!getTrade().isCurrentlyTrading()) { if (System.currentTimeMillis() > (announceofferTime + 30000)) typeStringInstant("Buying Santa Hats"); announceofferTime = System.currentTimeMillis(); } else { if (getTrade().getRequestListener() != null) { if (getTrade().getLastRequestingPlayer() != null) { if (getTrade().getLastRequestingPlayer().interact("Trade with")) { tradeTime = System.currentTimeMillis(); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return !getTrade().isCurrentlyTrading(); This is how I worked it out, I still havent run the bot to see if it works, there are still too many errors in the later code to save it properly, but I believe this has the effect I am looking for? I will still look into the method suggested above, but can anyone that sees this give any input on whether this would function?
  2. Thanks, I have no clue what the 0L is in the public long, but as I said, I am very new, I will user the links you provided to sort the banking thing, then start looking into the code you provided, thanks again for the reply
  3. And yes I am wholly aware there is a giant chunk of script missing lmao, I am frankensteining it together as I go... Just trying to sort how to use the commands I inquired about so I can add them in as I go, thanks again in advance EDIT: Follow up, and possible answer to my own question. Is there a way to set a value for announceofferTime = startTime UNTIL an announceTime has recorded a value?! I feel like this is the answer, I just don't know how to connect the dots lol Or, will adding it here fix this since it returns BELOW this line in the future?! long startTime; long announceofferTime; long tradeTime; public int onLoop() throws InterruptedException { startTime = System.currentTimeMillis(); announceofferTime = System.currentTimeMillis(); if (!getInventory().isEmpty()) { if (getBank().open()) { if (getBank().depositAll()) { if (getBank().close()) {} While typing this that came to me lol, I feel dumb, and will feel dumber if i am still wrong lol
  4. Ok, I am VERY new to the world of Java scripting, I have been reading up and such in the last couple weeks when I have the time and it's a struggle, but I am getting there lol. That said, bear with me as I'm sure these are super noob question. Also, quick shoutout, since I am super new I have been dissecting other peoples scripts and using them to learn, the one I am currently trying to make started with Malcom's GF Buyer for reference and it has been extremely useful in learning how/why things act and respond the way they do in the codes, so thanks a million for the open source script. With that said, clearly I have no claim to the content in this script, and am only displaying it to illustrate my questions. First super noob question, what is the code for withdraw "X" amount of coins from bank? and can someone please explain how to write "Inventory empty except coins" lol, you'll notice I dont have it set to take money out cuz I havent found that line yet lol... Second noob question, I am piecing together a buyer bot from the dissected bits of the GF Buyer script. I would like it to only announce the "Buying Offer" if it has not done so in X amount of Milliseconds, but still cycle through the trade listener/accept processes in the interim, so that it doesn't spam annoy the hell out of everyone. The following code may NOT work at all, I managed to make the GF buyer script hop worlds if it completed a trade (using a second account to activate trades n stuff), made it bank everything and accept any trade etc. and THINK I have this coded slightly right using those references... If it is just a complete fail, please just tell me so, and I will try again rather than asking you nice people to help me learn and rebuild the entire code if it's already FUBAR lol. Ok, the reason I can't wrap my head around how to do this is as follows - The short code below would (i think) Check to see has it been 30 seconds since announced, if so, announce, then log a NEW announcetime if (System.currentTimeMillis() > (announceofferTime + 30000)) { typeStringInstant("Buying Santa Hats"); announceofferTime = System.currentTimeMillis() ; So, I am not sure how to trigger it for the very first time, as in, how can it check ">" against a value that has yet to be written to begin the cycle? I thought, perhaps, the first line could trigger off the startTime in the script, but then how to make it switch to checking the announceofferTime henceforth. If this is harder than I am assuming it is, I don't expect anyone to waste a lot of valuable time so some noob can piddle around with scripting, but if there are simple methods that I am missing and someone could give me a push the right direction I would appreciate it tremendously. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- @ScriptManifest(author = "ThatGuy", info = "Announces Buy, Trades, Hops, Rinse&Repeat", name = "GE Buddy", version = 1.0, logo = "") public class GeBuddy extends Script { @Override public void onStart() { log("Let's Buy Stuff & Things"); } long startTime; long announceofferTime; long tradeTime; public int onLoop() throws InterruptedException { startTime = System.currentTimeMillis(); if (!getInventory().isEmpty()) { if (getBank().open()) { if (getBank().depositAll()) { if (getBank().close()) {} } else { if (System.currentTimeMillis() > (startTime + 300000)) { if (getWorlds().hopToP2PWorld()) { } else if (!getTrade().isCurrentlyTrading()) { if (getTrade().getRequestListener() != null) { if (getTrade().getLastRequestingPlayer() != null) { if (getTrade().getLastRequestingPlayer().interact("Trade with")) { tradeTime = System.currentTimeMillis(); } else { } new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return (!getInventory().isEmpty()); } }.sleep(); }
  5. Thanks everyone for taking the time to read my post, I have no idea what fixed it, but it is fixed lol... Also, I had attempted to backup my work so as not to lose what I had already, and made Main(2) it was interfering as well as it was made inside the project I had open and was giving an error of "Main already referenced" or something to that effect, deleting the backup resolved that and my first OSbot script ran as well as I expected lol. So I've just taken to saving the code to notepad for copy/paste if it goes to hell lol.
  6. Also, I am getting a lot of red lines when I copy and paste scripts from the forums, in the tutorial it states that the path may be the issue with excessive red lines and to refer back to those steps. SOME of the errors offer quick fix and allow me to import the proper class, then lines go away, but not all, and why is it not just able to access those files? Sorry, I know these are likely extremely dumb errors on my part, but I have exhausted myself trying to find the answer without having to beg for help lol, I admit my failure presently...
  7. Ok, I'm rather new here, and fairly new to using Java, but I still feel like I am missing something super simple, I used the Beginners Tutorial located in the forums to set everything up, and all seemed to go properly. What I am seeing though, is my path configuration doesn't look like the one in the tutorial (image provided) and I am getting a red line under the "p" in the very first line " package core; " w/ error message "The type org.osbot.lpT9 cannot be resolved. It is indirectly referenced from required .class files" Quick fix tells me to "Open the Java build path property page of project " then directs me to correct the path I configured the path as directed in the tutorial, and while doing so noticed that I had a different (older) version, I tried to find the version 2.5.6 as shown in tutorial but couldn't find a trustworthy working link. Is the issue directly related to the older version, or have I mucked something up trying to start out? If I DO need the other version of OSBot can someone please provide a working DL link please. Thanks in advance
×
×
  • Create New...