Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold

Search the Community

Showing results for tags 'read'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • TRiBot
    • News and Announcements
    • Old School Scripts
    • Help and Guidance
    • Development
    • Bugs and Errors
    • Tutorials
  • Scripters' Forums
    • Scripter Application
  • RuneScape®
    • General
    • Guides/Tutorials
    • Achievements
  • General
    • General
    • Questions
    • Discussions & Debates
    • Introductions
    • Suggestions
    • Feedback
  • The Black Market
    • Disputes
    • Repository Credits
    • Gold Exchange
    • Item Exchange
    • Membership Sales
    • Services
    • Other
    • Middleman Services

Blogs

  • Getting Started With TRiBot
  • The Best Way To Get Rid Of Termites
  • How to Generate Real Estate Leads Using Twitter
  • A Guide to Landing Pages
  • Dog Grooming in Sydney – 5 steps to finding a grooming salon
  • Cheap RS 2007 Gold for Spring 2020!
  • Logo Design Mistakes- Your Business Should Avoid at All Cost
  • Effective Pest Control Measures
  • В Алматы карантин из-за коронавируса: жизнь в условиях пандемии
  • Preschool Educational Toys, Helping One's Child Prepare For the Future
  • Automating Tribot
  • Payment error
  • Animal Crossing: New Horizons Cuts Player Interest Rates
  • network-security-engineer
  • SERVICES 100% BY HAND

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


Bio

Found 3 results

  1. Brief overview of what @TRiLeZ said over at the tribot discord chat. There might be an announcement later, but expect a fix to broken hooks soon.
  2. Everyone is cognizant in the reality that checking the status and substantial progress in which their bot has achieved brings much pleasure,Indeed it does. Pertaining to the basis of my experience I can only assume that most of us run our bots when we are "away from keyboard," so to speak; therefore, we are not entitled to that overwhelming abundance of joy and security in checking our bots progress and if our bot is running or not. My idea, an "app" that you log into and see your bots running in over-view mood mode. It would splendid to be able to run scripts, but just see our bots at work from our mobile devices would suffice. What do y'all think?
  3. /* * IOUtility.java 04/04/2014 * * VBsec */ package scripts.generalUtils; import java.awt.Desktop; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; import java.io.Writer; import java.net.URL; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.imageio.ImageIO; import org.tribot.api.General; public class IOUtility { private static final String TXT = ".txt"; /* * @param path = The path for saving the file to. e.g. new File(Util.getWorkingDirectory() + "\\Yourname-scripts\\YourScript") * @param name = The name of the file to be saved. * @param contents = The string you want to save. */ public static void saveTextFile(File path, String name, String contents) throws IOException { if (!path.exists()) path.mkdirs(); try (Writer output = new FileWriter(new File(path + "\\" + name + TXT)) { output.write(contents); } } /* * @param path = The path for saving the file to. * @param name = The name of the file to be saved. * @param contents = The string array you want to save. */ public static void saveTextFile(File path, String name, String[] contents) throws IOException { if (!path.exists()) path.mkdirs(); try (Writer output = new FileWriter(new File(path + "\\" + name + TXT)) { for (String line : contents) output.write(line + System.lineSeparator()); } } /* * @param path = The path that contains the file. * @param name = The name of the file to be read. * * Maximum length is 256 characters. Can be adjusted by changing the char array size. */ public static String readTextFile(File path, String name) throws Exception { if (!path.exists() || path.listFiles().length == 0) return null; try (Reader input = new FileReader(new File(path + "\\" + name + TXT)) { char[] chars = new char[256]; while (input.read(chars) != -1) ; String contents = String.valueOf(chars); return contents.trim(); } } /* * @param path = The path that contains the file. * @param name = The name of the file to be read. */ public static String[] readTextFileIntoArray(File path, final String fileName) throws Exception { String[] contents; if (!path.exists() || path.list(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.contains(fileName); } }).length == 0) return null; List<String> lines = Files.readAllLines( Paths.get(path.getAbsolutePath() + "\\" + fileName + TXT), Charset.forName("UTF-8")); contents = new String[lines.size()]; return lines.toArray(contents); } /* * @param urlString = The URL to open. e.g. "http://tribot.org" */ public static void openWebpage(String urlString) { try { if (Desktop.isDesktopSupported()) { Desktop.getDesktop().browse(new URL(urlString).toURI()); } else { Runtime runtime = Runtime.getRuntime(); runtime.exec("/usr/bin/firefox -new-window " + urlString); } } catch (Exception e) { General.println("Couldn't open the link to " + urlString + System.lineSeparator() + e.getMessage()); } } /* * @param path = The path to the images e.g. Util.getWorkingDirectory() + "\\Yourname-scripts\\YourScript" * @param names = An array containing the names of the images. Include the extension. e.g. { "mainPaint.png", "closeButton.png" } * * Store the returned array in a variable in the class you call the method from. e.g. BufferedImage[] images = IOUtility.readImages(path, names); */ public static BufferedImage[] readImages(String path, String[] names) { BufferedImage[] imageArray = new BufferedImage[names.length]; try { for (int i = 0; i < names.length; i++) { File imagePath = new File(path + "\\" + names); if (imagePath.exists()) imageArray = ImageIO.read(imagePath); else { General.println("Couldn't find image " + names); return imageArray; } } } catch (IOException e) { General.println("Couldn't find images." + System.lineSeparator() + e.getMessage()); return null; } return imageArray; } // utility method for downloadImages() private static boolean findImages(File path, String[] names) { File[] files = path.listFiles(); ArrayList<String> fileList = new ArrayList<>(); ArrayList<String> nameList = new ArrayList<>(); for (File f : files) fileList.add(f.getName()); Collections.addAll(nameList, names); return fileList.containsAll(nameList); } /* * @param path = The path to save the images to. * @param picNames = An array containing names that will be used when saving to file. Include the extension. e.g. { "mainPaint.png", "closeButton.png" } * @param links = An array of links for the images. The order must be the same as in the picNames array. e.g. {"http://www.tinypic.com/mainPaint.png", * "http://www.tinypic.com/closeButton.png" } */ public static boolean downloadImages(File path, String[] picNames, String[] links) throws IOException { if (!path.exists()) { path.mkdirs(); } else if (findImages(path, picNames)) return true; for (int i = 0; i < links.length; i++) { URL website = new URL(links); File file = new File(path + "\\" + picNames); try (InputStream input = website.openStream(); OutputStream output = new FileOutputStream(file) { int c; while ((c = input.read()) != -1) output.write(c); } } return false; } }
×
×
  • Create New...