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.

ArrayList to string

Featured Replies

Hey, my head just exploded. How can i pass this into a string for GroundItem? ex: GroundItem lewt = ("Huge turd", "Flashlight");

    public static ArrayList<String> GUILoot = new ArrayList<String>();

My arraylist outprints this atm:

 

[iNFO ][04/01/14 01:21:22 AM]: GUILoot: [Vial, Herb, Bones]

 

thanks!

 

Edited by daviyow

  • Author
GUILoot.toArray(new String[GUILoot.size()]);

 

 

If i try to log it, it says 

GUILoot: [Ljava.lang.String;@32f50bf4

log("GUILoot: "+GUILoot.toArray(new String[GUILoot.size()]));

 

? :troll:

 

If i try to log it, it says 

GUILoot: [Ljava.lang.String;@32f50bf4

log("GUILoot: "+GUILoot.toArray(new String[GUILoot.size()]));

 

? Troll.gif

Oh whoops, I misunderstood your original post :o just iterate through them.

  • Author

Oh whoops, I misunderstood your original post ohmy.png just iterate through them.

 

 

can i do that in my getState? cus i have some checks for loot in my state or where would be the past part to do this

can i do that in my getState? cus i have some checks for loot in my state or where would be the past part to do this

Wherever you think would be best. Forgot an ArrayList returned the string with brackets though, so you can just pass them in easy and replace the characters you don't want.

GUILoot.toString().replace("[", "").replace("]", "");

 

Wherever you think would be best. Forgot an ArrayList returned the string with brackets though, so you can just pass them in easy and replace the characters you don't want.

GUILoot.toString().replace("[", "").replace("]", "");

eww why #replace twice? ewwwww

String#replaceAll("[\\]\\[]", "")

public boolean lootOnGround(){
        GroundItem g;
        for (String s: GUILoot){
            g = closestGroundItemForName(s);
            if(g != null) return true;
        }
        return false;
    }

Or just closestGroundItemForName((String[])GUILoot.toArray()) to pass it as a whole

Edited by Ande


String[] array = {"s","n","d"};

String s = Arrays.toString(array);

System.out.println(s.replaceAll(", ","\",\"").replace("[","(").replace("]",")").replace("(","(\"").replace(")","\");"));

}

Idk it works but it should


String[] array = {"s","n","d"};

String s = Arrays.toString(array);

System.out.println(s.replaceAll(", ","\",\"").replace("[","(").replace("]",")").replace("(","(\"").replace(")","\");"));

}

Idk it works but it should

  • Author

 

Wherever you think would be best. Forgot an ArrayList returned the string with brackets though, so you can just pass them in easy and replace the characters you don't want.

GUILoot.toString().replace("[", "").replace("]", "");

 

 

Is that ok to place this under dispose(); at GUI?

Guest
This topic is now closed to further replies.

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.