Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Jerminater

Reading from excel file

Recommended Posts

I am working on framework for a large script, and the script would be much smaller and easier to troubleshoot/update if I was able to import data from an excel file. 

example: A collection of npc's the script encounters, their drop table, location, health, etc. 

I know I could use hashmaps to sort the data, but using an excel sheet would be much easier. I cannot find anything on this topic.

Share this post


Link to post
Share on other sites
2 minutes ago, jomac4694 said:

Quick google search gave me this: http://poi.apache.org/spreadsheet/index.html

Well Obviously it will be allowed in Java and there are ways to do it, I was just trying to figure out if Tribot allows it, blocks it, and encourages it.

 

Also, if I were to use the script in the repository, how other users would be able to access the excel document as well.

 

Thanks for the response though! If you can answer these questions let me know.

Share this post


Link to post
Share on other sites
Just now, Jerminater said:

Where can I learn the relevant information in creating/using one? I have no experience here.

These are a good start. For what I assume you'd need, it'll be fairly simple. It's only when you begin storing 'valuable' information you need to worry. :P I'd also take a look at some Php basics too.

 

Share this post


Link to post
Share on other sites
3 minutes ago, HeyImJamie said:

These are a good start. For what I assume you'd need, it'll be fairly simple. It's only when you begin storing 'valuable' information you need to worry. :P I'd also take a look at some Php basics too.

 

Thanks for the references Jamie! :) 

 

I have a lot of experience programming in other languages, but nothing that is OOP or anything like Tribot, so it is taking some getting used to!

 

(Got a degree in chemical engineering, working as an automation engineer, with a passion for programming in my spare time lol!)

Share this post


Link to post
Share on other sites
9 minutes ago, Jerminater said:

Thanks for the references Jamie! :) 

 

I have a lot of experience programming in other languages, but nothing that is OOP or anything like Tribot, so it is taking some getting used to!

 

(Got a degree in chemical engineering, working as an automation engineer, with a passion for programming in my spare time lol!)

I'm sure you're much better versed than I am then :P This is purely a hobby for me, but if you're stuck I'll try to help where I can. :) Best of luck!

Share this post


Link to post
Share on other sites
1 hour ago, Jerminater said:

example: A collection of npc's the script encounters, their drop table, location, health, etc. 

For that you could just print to a .txt file. Using something like a spreadsheet might have some benefits, but I would probably just generate a .txt file for each unique NPC ID you encounter and save it to the same folder.

An efficient setup would be to have a folder that houses .txt files whose names are the IDs of each NPC you want to track. Then within each .txt file you could have a line for each field you want to save.

Then when you want to retrieve the files, you could do:

for (File file : myFolder.listFiles()) {
	// do something
}

and sort them into a hashmap or however you want to organize the ID files.

This could all easily be done in pure Java, so no dependencies.

Edited by IceKontroI
  • Like 1

Share this post


Link to post
Share on other sites

If you used something like a csv file you could probably parse it via the comma delimiter? You can load those in excel for easy editing, and you wouldn't need excel to view it, as they can be opened in most text editors

If you wanted to use that file in the script on the repository, your best bet would be to upload it to an external host (like pastebin) and then have your script grab the file from pastebin and then parse it as desired.

Edited by Fluffee

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Our picks

    • This update features:

      Fixed broken hooks from today's update


      Fix wilderness level with RuneLite (Thanks @Todd)


      Add support for Kotlin .class files in scripts (Thanks @wastedbro)


      Overhaul Inventory API (Thanks @wastedbro)


      Add List support for common methods


      Change method grouping to make more sense (by functionality)


      Refactor methods to utilize Java 8 streams instead of cumbersome loops




      Recognize chatbox minimization (Thanks @JoeDezzy1)


      Fix Screen#isInViewport when NPC chat is open (Thanks @JoeDezzy1)


      Fix login bot bugs (Thanks @erickho123)


      Fix hint arrow return values (Thanks @Encoded)


      Fix depositAllExcept functionality (Thanks @wastedbro)


      Change containing box interface bound and adjust for Y values (Thanks @erickho123)
        • Like
      • 151 replies
    • This release will:

      Fix prayers and world hopper API (Thanks @JoeDezzy1 and @erickho123)


      Improve banking API (Thanks @Encoded)


      Adds methods for returning and using Java Lists, rather than arrays


      Slightly randomizes some hardcoded behaviour


      Removes sleeps from waitConditions; the efficiency saving potential is negligible in these use-cases, therefore cleaner code is preferable


      Other back-end improvements





      Note: If you are using LG, please restart both the RS client and TRiBot.
        • Sad
        • Haha
        • Thanks
        • Like
      • 90 replies
    • This release will:

      Add new internal framework for capturing exceptions


      Fix issue with not selecting the last column in world hopper (Thanks @Todd)


      Add a message about pin usage in Banking#openBank (Thanks @Todd)


      Disable the firewall by default (Thanks @Todd)


      Fix handling of the welcome screen after login (Thanks @Encoded)


      Fix wrong amount bank withdrawal (Thanks @Encoded)


      Fix Screen#isInViewport


      Fix Game#isInViewport (Thanks @Encoded)


      Call onBreakEnd for ListenerManager Breaking Listeners (Thanks @Encoded)


      Fix Prayer#getPrayerPoints NumberFormatException (Thanks @JoeDezzy1)



      Note: If you are using LG, please restart both the RS client and TRiBot.
        • Thanks
        • Like
      • 28 replies
    • This release will:

      Fix LG for both OSBuddy and RuneLite


      Fix issue where the resizable client isn't able to be made smaller (Thanks @JoeDezzy1)


      Fix detection of the logout game tab when resizable mode and side panels are enabled (Thanks @JoeDezzy1)


      Add initial support for Sentry to allow us to identify and easily debug exceptions happening with all TRiBot users


      Add methods to determine if the bank is actually loaded, and not just the overarching interface (Thanks @wastedbro)



      Upcoming updates:

      Improved CLI support


      Full Sentry support


      Much more
        • Like
      • 64 replies
    • This release will:

      Fix NPE in Camera API (Thanks @wastedbro)


      Update deposit box interface ids (Thanks @Encoded)


      Add various bank methods (Thanks @wastedbro)


      Banking#getWithdrawXQuantity


      Banking#getDefaultWithdrawQuantity


      Banking#arePlaceholdersOn




      Fix resizeable minimap bug (Thanks @wastedbro)


      Remove Java 8 requirement


      Please note: TRiBot is not yet fully compatible with Java 10+




      Fix the break handler issues by ensuring the break handler thread never gets paused


      Fix broken settings hooks



      Upcoming updates:

      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Like
      • 68 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...