Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[withdrawing an addy scim with getbank().withdraw method] Not sure if bug or something weird with my code (possible bug?)

Featured Replies

So I have no idea wtf is happening. I thought I coded something wrong, maybe it's just my computer. 

So I have an id for all the scimitars in the game. 

When I call getBank().withdraw(idname, 1); My client lags so god damn hard like something is going to shit. So I tried it with food, strangely enough no lag. Could this be a bug with my code or this certain ID?

So I have int idname = theid; in this case its  1331. Now when I call it on purpose this happens  

https://puu.sh/sJik7/fb7c80c853.mp4 notice when I pushed stop the mini map stops lagging and everything goes well.

 

Now if I was to recreate this with food, this is the result https://puu.sh/sJios/0194facc6e.mp4 

So I'm not sure what is exactly happening.... Forcing both of them the exact same way, is it a bug?

 

EDIT3: Solved, if this occurs for you then it's your OnPaint method somewhere. I fixed it by removing a line. 

Edited by lol0

Best would be not to use ID's. Better hardcode the names of the scimitars.

bank.withdraw("Adamant scimitar", 1);

Edit: Also a good idea would be to use conditional sleeps between each withdrawal, like: 

new ConditionalSleep(3000, 500) {
   @[member=Override]
   public boolean condition() throws InterruptedException {
	return bank.withdraw("Adamant scimitar", 1);
    }.sleep();

Have your logger opened when trying do withdraw stuff your way. I suspect a null pointer exception.

Edited by nosepicker

  • Author

 

Best would be not to use ID's. Better hardcode the names of the scimitars.

bank.withdraw("Adamant scimitar", 1);

Tried with strings too, still the same result. There's a bug with the method somewhere. I'm not sure if it's only for the addy scim. I will test it out for the other scims too!

 

 

Edit: Also a good idea would be to use conditional sleeps between each withdrawal, like: 
new ConditionalSleep(3000, 500) {
   @[member='Override']
   public boolean condition() throws InterruptedException {
	return bank.withdraw("Adamant scimitar", 1);
    }.sleep();

Have your logger opened when trying do withdraw stuff your way. I suspect a null pointer exception.

I always have the logger opened. I tried with condition sleeps and without condition sleeps and even normal sleeps, still the same thing... 

No null pointer exception. I declare it, a bug...  

Edited by lol0

Maybe it's something else in your code, I never has any issues with things lik that.

Mind showing your whole code?

 

if you have a npe in your paint, no error will be shown in the logger, but lagg can occur :)

Try to start the client from cmd line with -debug paramater,t hat way you can see every single error.

  • Author

Maybe it's something else in your code, I never has any issues with things lik that.

Mind showing your whole code?

 

if you have a npe in your paint, no error will be shown in the logger, but lagg can occur smile.png

Try to start the client from cmd line with -debug paramater,t hat way you can see every single error.

 

Lmfao yep, it was. Commented the whole paint line out and boom, no lagg.  By all means, what does NPE mean? I've never heard of NPE. NPC Entity? (sorry if it's wrong) Null Pointer Exception, took me a while to realize (was too busy focusing on my script). 

 

But why did it only occur with adamant scims and nothing else? Super weird.

g.setColor(Color.WHITE);
//Time Drawn on the Screen
timeRan = System.currentTimeMillis() - this.timeBegan;
g.drawString(ft(timeRan), 125, 392);

//Drawing Numbers of the Screen
currentXPAttack = skills.getExperience(Skill.ATTACK);
xpGainedAttack = currentXPAttack - beginningXPAttack;
currentLevelAttack = skills.getStatic(Skill.ATTACK);
levelsGainedAttack = currentLevelAttack - beginningLevelAttack;
g.drawString("" + xpGainedAttack + " (" + levelsGainedAttack + ")", 136, 440);

currentXPStrength = skills.getExperience(Skill.STRENGTH);
xpGainedStrength = currentXPStrength - beginningXPStrength;
currentLevelStrength = skills.getStatic(Skill.STRENGTH);
levelsGainedStrength = currentLevelStrength - beginningLevelStrength;
g.drawString("" + xpGainedStrength + " (" + levelsGainedStrength + ")", 140, 465);

currentXPHitpoints = skills.getExperience(Skill.HITPOINTS);
xpGainedHitpoints = currentXPHitpoints - beginningXPHitpoints;
currentLevelHitpoints = skills.getStatic(Skill.HITPOINTS);
levelsGainedHitpoints = currentLevelHitpoints - beginningLevelHitpoints;
g.drawString("" + xpGainedHitpoints + " (" + levelsGainedHitpoints + ")", 140, 413);

g.drawString("Status:",27,53); g.drawString(getState().toString(),75,53);

This is the whole onPaint code. It lags when I have it on and I want to keep it on. I'm assuming its the time ran which is causing it to go all crazy. How would I solve it without having to remove it?

 

Edit found the problem "g.drawString("Status:",27,53); g.drawString(getState().toString(),75,53);"  I had this in there temp for debugging purposes as I like to use the console for the actual loops.... I guess I'll have to find another way. 

Edited by lol0

Lmfao yep, it was. Commented the whole paint line out and boom, no lagg.  By all means, what does NPE mean? I've never heard of NPE. NPC Entity? (sorry if it's wrong) Null Pointer Exception, took me a while to realize (was too busy focusing on my script). 

 

But why did it only occur with adamant scims and nothing else? Super weird.

g.setColor(Color.WHITE);
//Time Drawn on the Screen
timeRan = System.currentTimeMillis() - this.timeBegan;
g.drawString(ft(timeRan), 125, 392);

//Drawing Numbers of the Screen
currentXPAttack = skills.getExperience(Skill.ATTACK);
xpGainedAttack = currentXPAttack - beginningXPAttack;
currentLevelAttack = skills.getStatic(Skill.ATTACK);
levelsGainedAttack = currentLevelAttack - beginningLevelAttack;
g.drawString("" + xpGainedAttack + " (" + levelsGainedAttack + ")", 136, 440);

currentXPStrength = skills.getExperience(Skill.STRENGTH);
xpGainedStrength = currentXPStrength - beginningXPStrength;
currentLevelStrength = skills.getStatic(Skill.STRENGTH);
levelsGainedStrength = currentLevelStrength - beginningLevelStrength;
g.drawString("" + xpGainedStrength + " (" + levelsGainedStrength + ")", 140, 465);

currentXPHitpoints = skills.getExperience(Skill.HITPOINTS);
xpGainedHitpoints = currentXPHitpoints - beginningXPHitpoints;
currentLevelHitpoints = skills.getStatic(Skill.HITPOINTS);
levelsGainedHitpoints = currentLevelHitpoints - beginningLevelHitpoints;
g.drawString("" + xpGainedHitpoints + " (" + levelsGainedHitpoints + ")", 140, 413);

g.drawString("Status:",27,53); g.drawString(getState().toString(),75,53);

This is the whole onPaint code. It lags when I have it on and I want to keep it on. I'm assuming its the time ran which is causing it to go all crazy. How would I solve it without having to remove it?

 

Edit found the problem "g.drawString("Status:",27,53); g.drawString(getState().toString(),75,53);"  I had this in there temp for debugging purposes as I like to use the console for the actual loops.... I guess I'll have to find another way. 

 

Yes it's a nullpointer exception, meaning that you are trying to acces a variable that is null.

I'm glad you found your issue now, if you any more questions, feel free to ask me :)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.