Jump to content

Schepto

Trade With Caution
  • Posts

    17
  • Joined

  • Last visited

  • Feedback

    0%

About Schepto

Profile Information

  • Gender
    Male

Recent Profile Visitors

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

Schepto's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. EDIT got the difference between them now. also thank you for serving me. Sorry I was disrespectful this is a good community. sorry that I was rude but I firmly disagree that being rude is a bad path. It may make people dislike me but it gets me talking to the people who know the most the fastest. I am not looking for someone to pat me on the back. It is easier to ask for forgiveness then for permission. EDIT gonna keep using snake_case for personal projects. I would not bother working on a java project anyways. (<-- not trying to say im too good for java infact java is just too old from what im use to and legacy code sucks and pays dog shit(at least compared to the skill it takes.. you guys are way smarter and get way less and I don't understand the masochism... ill stick to tensorflow and matlib for now)).
  2. Hnnggg I think I have spotted my retardedness... Please halp tear me apart in my "defense" Tho I think I covered the parts I have found where I was wrong.
  3. Most my questions were answered by myself. I am looking for real input and back and forth with people who understand efficiency. This was not going to be a pretty thread to be begin with as most people who will even be worth talking to this about will probably take this as an insult for whatever reason. I am just waiting for @Alek and or @Chris if he is more then a Alek fanboy to tell me why I am retarded so I can learn from it. Bash me all you want but I would prefer you would do it in the way of my code for this thread. Then you can send me hate in PM that I can ignore.
  4. I want to listen to him because he knows more then me. But I don't want to hear BS that I doubt even he believes. If he can not entertain my questions then he is not worth my time. Even if all of you think I am an idiot. Java is not hard.
  5. Hey, what does this mean!? Are you saying I think try / catch nullpointer is the same as != null?(wait.... I do think this... (I think i think this??? Check my response to Chris below) (Probably stupid statement ->) EVEN IF INSIDE THE onLoop()... So no... its not pointless. Thanks for making me double check tho(didn't double check... dunno why I said this). Go ahead and provide me with a low level example(something I will never understand because fuck math) why I am dumb(I am dumb) even tho thats not the point of High level lang tho.(because the low level guys enable me to be retarded like this) I want to learn Java(be lazy)... not ASM(hard work that I will fail at) @Alek Not everyone has the low level knowledge you do(because they didn't work as hard and expect to leech from you like me). Stop expecting people to have that(you fucking alien). Your using practicies from Java 6 that are far from relevant now(no authority to say this, just talking out my ass here). I chose the wrong person to learn from. (This is still true, even post edit) (but not really true, post post edit i was an asshole) You are correct this is one of the parts I felt was really stupid....(Referring the try return NPC block below... not the thing above) even if im talking out of my ass for most of this this felt like especially extra ass talkery. The point of the second null check was simply to satisfy the compiler even if it "might be dumb" it will still null check and will print me a log instead of crashing your entire OSBOT (Even more dumb IMO) (<-- I still think this is stupid, can you really not prevent making ANY cpu ramp at 100 because of a null pointer?... BULLSHIT) The same reason why I try catch it while you ignore it in your youtube videos @Chris What happens if a noob references a null object? A big, horrendous time consuming crash that you need to alt f4 to end. Woo welcome to Java 8! Is this not null checked? afaik Its looped inside a Try block that catches null pointers... sorry for not typing if != null like an idiot for every object. (God damn I hope this is right because fuck if(myCancer != null) { DoBullShit(); }
  6. Hmm... I still dont get it and I have been with OOP for a fair bit.... Could you please explain why this is important...? Is Java really that bad? Its a high level language... it should not need low level mastery to perform well.... Sure the points you make are important but if a high level lang dev needs to know all these intricacies then Java seems like a really bad language which I just refuse to believe due to its popularity. I know its messy but that just seems like bad practice more then messy language. The developers of java are not dumb and I fail to believe they will not cater to noobs like me. Are you sure this is not practice you picked up in legacy code? because It just does not click to me and seems like old af like objective C from back in the early 2000's Is this really as bad as you say it is now... or is this just legacy practice hanging on...
  7. Hello, I am attempting to learn OSBot but I such at Java as it seems like a cancerous mess compared to more noob friendly languages. Plz halp and tell me why I am retarded. My Main class package Script; import Quests.Questing; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import Methods.*; @ScriptManifest(author = "Schepto", name = "Schepto", info = "", version = 1, logo = "") public final class Main extends Script { private Lib lib = new Lib(); // Library of generic functions and methods. private Questing questing = new Questing(); // Takes care of any quest I will ever need to do. private void ExchangeContext() { // TBH... All of this is black magic to me and I have no clue why I gotta do this. lib.exchangeContext(getBot()); questing.exchangeContext(getBot()); } @Override public final void onStart() { // Happens only once when you first start the bot and after it logs in ExchangeContext(); // This must always be first, Prevents NullPointers via black magic. } @Override public final int onLoop() { int randomDelay = random(1000, 2000); try { questing.Execute(); // All individual quests will extend to execute. Those individual quest classes have access to my lib of functions to make writing scripts way faster. } catch (NullPointerException n) { log(n.getCause() + " " + n.getMessage()); } return randomDelay; } } Placeholder Lib Class with minimal features. package Methods; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.EquipmentSlot; import org.osbot.rs07.api.ui.Tab; import org.osbot.rs07.script.MethodProvider; import java.util.List; public class Lib extends MethodProvider { protected enum ATTACK_STYLES { ATTACK(0), STRENGTH(1), DEFENSE(3); private final int value; ATTACK_STYLES(int value) { this.value = value; } public int get() { return value; } } protected void attack(ATTACK_STYLES attack_style, String mob) { switch (attack_style.get()) { // TODO: Finish this switch statement and include combat style swapping logic. case 0: if(configs.get(43) != 0) { // If we are not in the right attack style tabs.open(Tab.ATTACK); // Click the Attack Style } else { // our attack style is correct, Go kill some mobs. log("Placeholder"); // Attack our mob. } break; case 1: break; case 3: break; } } protected void equipment_check(List<String> equips) { equips.forEach(equip -> { // Loop through the list of equipment to check what we need to do. EquipmentSlot slot = equipment.getForNameThatContains(equip); // Grab the slot of our current item if (!equipment.isWearingItem(slot, equip)) { // If we are not wearing the item if (!inventory.contains(equip)) { // if we do not have the item in our inventory withdraw_item(equip); // then get it from the bank } else { // if we already have one in our inventory equipment.equip(slot, equip); // then equip it } } }); } private void find_bank() { // TODO: Convert to array of banks based on if on member world or not. walking.webWalk(Banks.LUMBRIDGE_UPPER); // FIXME : Calculate the closest bank based off the array of banks. } private NPC find_mob(String mob) { try { return npcs.closest(mob); } catch (NullPointerException n) { log("Unable to find a " + mob); return null; } } protected void tool_check(List<String> tools) { tools.forEach(tool -> { // Loop through the list of tools to check to see if we need to get something. if (!inventory.contains(tool)) { // If we do not have the tool in our inventory check the bank for it. withdraw_item(tool); } }); } protected void withdraw_item(String item, Integer amount) { try { if (!bank.open()) { // if bank is not open find_bank(); // then take us to the nearest bank RS2Object booth = objects.closest("Bank booth"); // find the closest Bank Booth if (booth != null) { // make sure the bank booth is not null booth.interact(); // and then interact with it } } else { // else if our bank is already open withdraw what we need log("Withdrawing " + amount + " " + item); bank.withdraw(item, amount); } } catch (InterruptedException error) { log(error); } } protected void withdraw_item(String item) { // overload for withdraw_item so we don't need to type on 1 for amounts if we just need one. withdraw_item(item, 1); } } What I think is a terrible way to extend my Questing classes.... which extend Lib... Tell me why I am retarded here please package Quests; import Methods.Lib; public class Questing extends Lib { private CooksAssistant cooksAssistant = new CooksAssistant(); private SheepShearer sheepShearer = new SheepShearer(); public void Execute() { cooksAssistant.Execute(); sheepShearer.Execute(); } } Cooks Assistant Placeholder here. (Also can I not make these classes a static method like python?... kind of doubt it but if I can make these faster please let me know) package Quests; import org.osbot.rs07.api.Quests; public class CooksAssistant extends Questing { public void Execute() { log("This is a placeholder for Cooks Assistant Quest."); if (!quests.isComplete(Quests.Quest.COOKS_ASSISTANT)) { log("We need to finish Cooks Assistant"); // Logic to finish the quest here } } }
  8. Why put this inside an if statement EVERY TIME...? instead of try / catching onLoop and then passing my methods into that? It seems to catch them just fine even if I mess up as long as I extend to my Lib which i think is initialized into the Main Script onStart and checked from that...(Uses deprecated exchangecontext.(getbot) at least thats how I think it works ( Super noob in Java ).
  9. All null pointers I get are generally Noob mistakes. I still don't understand this exchangecontent nonsense and why I need to do it.... it really seems like a hack to me. But forgetting to do that is the real reason I have found to catch a nullpointer. Other then possibly a mob not being near but != null seems better for this. That being said what is the point of InterruptedException? I know what a nullpointer is but wat is diz??? *confused*
  10. Hello, I am a noob in Java and am wondering what the point is for OSBot scripting to use things like throw instead of try / catch. I have yet to find a use case for throwing an interruptedexception but catching nullpointers is very useful (because im a noob). What is the difference in this context?
  11. Why are you doing a null check inside a lamda? Just try except null and put the lamda cast into the try block.
  12. Thank you both @devilsouler and @Burundanga for the responses!
  13. It is done when it is done. Your accounts are worth more then an early release. Dunno what thursday means in terms of OSRS botting. Is this downtime normal? ( I am a noob in this scene )
  14. Yay!!! Thank you so much. I was hoping this was not on me
  15. Hello, Upon trying to teach a friend of mine java with this botting framework I found this error and am quite confused! Basically we are running the same code that has always worked but upon testing our script recently after a break(Very minimal but I am wondering if this is a recent issue) we come across this black screen. https://i.imgur.com/C33IW7L.png What on earth have I done to bork it? Or is this a common issue. I will provide any source if needed but it is using basic classes extending MethodProvider with the safe exchangemethod (onStart) provided by explv package Script; import Tasks.GetBond; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import Methods.*; @ScriptManifest(author = "Schepto", name = "Schepto", info = "", version = 1, logo = "") public final class Main extends Script { private Initialize init = new Initialize(); // Initialization logic to be ran onStart private Evaluate eval = new Evaluate(); // Evaluation logic to determine needed Tasks private Lib lib = new Lib(); // Library of generic functions and methods. private GetBond bond = new GetBond(); private void ExchangeContext() { init.exchangeContext(getBot()); eval.exchangeContext(getBot()); lib.exchangeContext(getBot()); bond.exchangeContext(getBot()); } @Override public final void onStart() { // Happens only once when you first start the bot and after it logs in ExchangeContext(); // This must always be first, Prevents NullPointers via black magic. try { init.Init(); // Initialization } catch (NullPointerException n) { // Error Handling log("Null Pointer, Check for missing exchangeContext's " + n); } } @Override public final int onLoop() { // Gets executed once every 1~2s int randomDelay = random(1000, 2000); // Assigning a local var each iteration is faster then re-rolling into a global field. // Main logic body try { bond.Run(); } // Error handling catch (NullPointerException n) { log(n.getCause() + " " + n.getMessage()); } return randomDelay; } } package Methods; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.MethodProvider; public class Lib extends MethodProvider { private void find_bank() { walking.webWalk(Banks.LUMBRIDGE_UPPER); } private void withdraw_item(String item, Integer amount) { try { if (!bank.open()) { find_bank(); RS2Object booth = objects.closest("Bank booth"); if (booth != null) { booth.interact(); } } else { log("Withdrawing " + amount + " " + item); bank.withdraw(item, amount); } } catch (InterruptedException error) { log(error); } } protected void withdraw_item(String item) { withdraw_item(item, 1); } }
×
×
  • Create New...