Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
/** * Copy everything in the following tag.. * * //COPY * this is what you will copy.. * //ENDCOPY */ import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.LinkedList; import javax.imageio.ImageIO; import org.rsbot.event.listeners.PaintListener; import org.rsbot.script.*; import org.rsbot.script.methods.Skills; @ScriptManifest(authors = {"Dew"}, keywords = {"Paint"}, name = "FuserPAINT", description = "Demo Paint - To Be Edited", version = 1.0) public class paintforubuntu extends Script implements PaintListener, MouseListener { //COPY - these are needed variables public long startTime = 0, millis = 0, hours = 0, minutes = 0, seconds = 0; public Double ver = getClass().getAnnotation(ScriptManifest.class).version(); Point p; private int startXP = 0; private int XPGained = 0; public boolean showPaint = true; private String Status = "Setting up"; public MousePaint mousePaint = new MousePaint(); public Image fuserScriptsLogo, userLogo, paintBackGround, closeButton, openButton, Avatar; //ENDCOPY //COPY Color Color1 = new Color(255, 255, 255), Transparent = new Color(255, 255, 255, 0); Font Font1 = new Font("Calibri", 1, 14), Font2 = new Font("Calibri", 0, 14), Font3 = new Font("Calibri", 0, 9); //ENDCOPY //COPY -These are needed to make the image links work Rectangle fuserScriptsLogoRectangle = new Rectangle(4, 276, 207, 69), userLogoRectangle = new Rectangle(9, 347, 124, 28), closeButtonRectangle = new Rectangle(426, 345, 22, 22), openButtonRectangle = new Rectangle(474, 345, 22, 22), avatarRectangle = new Rectangle(448, 345, 65, 65); //ENDCOPY @Override public boolean onStart() { //COPY -these are the images to load // (CHANGE}url to the user avatar spot - Your Avatar HERE - MAKE // SURE the pixel ratio is 65x65px Avatar = getImage("http://i.imgur.com/XaXmd.png"); // (CHANGE)URL to the user logo spot - Your Logo HERE - MAKE // SURE the pixel ratio is 124x28px userLogo = getImage("http://i.imgur.com/yzKFM.png"); fuserScriptsLogo = getImage("http://i.imgur.com/yzKFM.png"); paintBackGround = getImage("http://i.imgur.com/9vt7j.png"); closeButton = getImage("http://i.imgur.com/RqFu8.png"); openButton = getImage("http://i.imgur.com/OPMSU.png"); //ENDCOPY return true; } //COPY private Image getImage(final String url) { try { return ImageIO.read(new URL(url)); } catch (final IOException e) { return null; } } //ENDCOPY //COPY -- this is the actual paint itself // <editor-fold defaultstate="collapsed" desc="Paint"> private final RenderingHints renderHints = new RenderingHints( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); public void mainPaint(Graphics g) { Graphics2D g2 = (Graphics2D) g; // (CHANGE) Change the skill. if ((skills.getCurrentExp(Skills.CONSTRUCTION) - startExperience) > 0 && startExperience > 0) { experienceGained = skills.getCurrentExp(Skills.CONSTRUCTION) - startExperience; } long millis = System.currentTimeMillis() - startTime; long totalseconds = millis / 1000; long hours = millis / (1000 * 60 * 60); millis -= hours * 1000 * 60 * 60; long minutes = millis / (1000 * 60); millis -= minutes * 1000 * 60; long seconds = millis / 1000; if (showPaint) { g2.drawImage(fuserScriptsLogo, 4, 276, null); g2.drawImage(paintBackGround, -1, 328, null); g2.drawImage(userLogo, 9, 347, null); g2.drawImage(closeButton, 426, 345, null); g2.drawImage(Avatar, 448, 345, null); g2.setColor(Constants.Transparent); g2.draw(Constants.fuserScriptsLogoRectangle); g2.draw(Constants.closeButtonRectangle); g2.draw(Constants.userLogoRectangle); g2.setColor(Constants.Color1); // START - current script version text g2.setFont(Constants.Font1); g2.drawString("Current Script Version:", 197, 358); g2.setFont(Constants.Font2); g2.drawString( "" + getClass().getAnnotation(ScriptManifest.class).version(), 335, 358); // END - current script version text // EDIT - Close Button Text - Remove or leave //g2.setFont(Constants.Font3); //g2.drawString("Close Button:", 373, 353); // EDIT - End of Close Button Text // START - Run Time g2.setFont(Constants.Font1); g2.drawString("Run Time:", 14, 400); g2.setFont(Constants.Font2); if (startTime != 0) { g2.drawString(hours + " Hours " + minutes + " Minutes " + seconds + " Seconds", 121, 400); } else { g2.drawString("Script loading...", 121, 400); } // END - Run Time // START - Experience if (experienceGained > 0 && totalseconds > 0) { g2.setFont(Constants.Font1); g2.drawString("Total Xp Gained:", 12, 431); g2.setFont(Constants.Font2); g2.drawString("" + experienceGained, 120, 431); g2.setFont(Constants.Font1); g2.drawString("Xp/hr:", 10, 462); g2.setFont(Constants.Font2); experiencePerHour = (int) (3600 * experienceGained / totalseconds); g2.drawString("" + experiencePerHour, 119, 464); //CHANGE, uncomment calculations if needed // runesPerHour = (int) (3600*runesMade/totalseconds); // essensePerHour = (int) // (3600*((int)((expGained)/runeExp))/totalseconds); // totalProfit = (long) // ((runesMade*runePrice)-(essenceCount*essencePrice)); // profitPerHour = (long) (3600*totalProfit/totalseconds); } // END - Experience // START - Time to Next Level long timeToLevel = 0; g2.setFont(Constants.Font1); g2.drawString("Time to Next Level:", 340, 454); g2.setFont(Constants.Font2); String timeToLevel2 = "Calculating..."; g2.drawString(timeToLevel2, 454, 454); if (experiencePerHour > 0) { g2.setFont(Constants.Font2); timeToLevel = (skills.getExpToNextLevel(Skills.CONSTRUCTION) * 60 / experiencePerHour); if (timeToLevel >= 60) { long thours = (int) timeToLevel / 60; long tmin = (timeToLevel - (thours * 60)); timeToLevel2 = thours + " Hours, " + tmin + " Minutes"; } else { timeToLevel2 = timeToLevel + " Minutes"; } } // END - Time to Next Level // START - Script Status g2.setFont(Constants.Font1); g2.drawString("Script Status:", 200, 473); g2.setFont(Constants.Font2); g2.drawString(Status, 283, 474); // END - Script Status } else { g2.setColor(Constants.Transparent); g2.draw(Constants.openButtonRectangle); g2.drawImage(openButton, 474, 345, null); } } @Override public void onRepaint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHints(renderHints); mainPaint(g2); mousePaint.Draw(g2); } // </editor-fold> //END //COPY -- this is needed to make links work // <editor-fold defaultstate="collapsed" desc="mouseClicked"> @Override public void mouseClicked(MouseEvent mouseEvent) { Point mousePoint = mouseEvent.getPoint(); if (Constants.fuserScriptsLogoRectangle.contains(mousePoint) && showPaint) { sendToURL("http://fuserscripts.cz.cc/community/"); } else if (Constants.userLogoRectangle.contains(mousePoint) && showPaint) { log("Currently, the Thread is not active! Please wait until I update this."); // sendToURL("http://fuserscripts.cz.cc/community/index.php?/topic/76-fuserpaint-skeleton/"); } else if (Constants.avatarRectangle.contains(mousePoint) && showPaint) { sendToURL("http://fuserscripts.cz.cc/community/index.php?/user/19-dew/"); } else if (Constants.closeButtonRectangle.contains(mousePoint) && showPaint) { showPaint = false; } else if (Constants.openButtonRectangle.contains(mousePoint) && !showPaint) { showPaint = true; } } public void sendToURL(String url) { try { java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); } catch (Exception exception) { log("[ERROR]SendToURL: " + exception.getLocalizedMessage()); } } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } // </editor-fold> //ENDCOPY //COPY -- this is the mouse stuff. // <editor-fold defaultstate="collapsed" desc="MousePaint"> public class MousePaint { public int waveSize = 0; @SuppressWarnings({"serial"}) public class mousePathPoint extends Point { private long finishTime; private double lastingTime; public mousePathPoint(int x, int y, int lastingTime) { super(x, y); this.lastingTime = lastingTime; finishTime = System.currentTimeMillis() + lastingTime; } public boolean isUp() { return System.currentTimeMillis() > finishTime; } } public double getRot(int ticks) { return (System.currentTimeMillis() % (360 * ticks)) / ticks; } public LinkedList<mousePathPoint> mousePath = new LinkedList<mousePathPoint>(); public void drawTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setStroke(new BasicStroke(1)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) { mousePath.remove(); } Point clientCursor = mouse.getLocation(); mousePathPoint mpp = new mousePathPoint(clientCursor.x, clientCursor.y, 250); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) { mousePath.add(mpp); } mousePathPoint lastPoint = null; for (mousePathPoint a : mousePath) { if (lastPoint != null) { long mpt = System.currentTimeMillis() - mouse.getPressTime(); if (mouse.getPressTime() == -1 || mpt >= 250) { g2.setColor(Color.GREEN); } if (mpt < 250) { g2.setColor(Color.RED); } g2.drawLine(a.x, a.y, lastPoint.x, lastPoint.y); } lastPoint = a; } } public void drawMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHints(new RenderingHints( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); g2.setStroke(new BasicStroke(3)); g2.setColor(Color.BLACK); g2.drawOval(mouse.getLocation().x - 13, mouse.getLocation().y - 13, 25, 25); g2.setStroke(new BasicStroke(1)); g2.setColor(new Color(0, 0, 0, 114)); g2.fillOval(mouse.getLocation().x - 13, mouse.getLocation().y - 13, 25, 25); Point MouseLocation = mouse.getLocation(); long mpt = System.currentTimeMillis() - mouse.getPressTime(); g2.rotate(Math.toRadians(getRot(5)), mouse.getLocation().x, mouse.getLocation().y); if (mouse.getPressTime() == -1 || mpt >= 250) { g2.setColor(Color.GREEN); g2.drawLine(MouseLocation.x - 5, MouseLocation.y, MouseLocation.x + 5, MouseLocation.y); g2.drawLine(MouseLocation.x, MouseLocation.y - 5, MouseLocation.x, MouseLocation.y + 5); } if (mpt < 250) { g2.setColor(Color.RED); g2.drawLine(MouseLocation.x - 5, MouseLocation.y, MouseLocation.x + 5, MouseLocation.y); g2.drawLine(MouseLocation.x, MouseLocation.y - 5, MouseLocation.x, MouseLocation.y + 5); } } public void drawWave(Graphics g, Color color) { Graphics2D g2 = (Graphics2D) g; Point MouseLoc = mouse.getPressLocation(); long mpt = System.currentTimeMillis() - mouse.getPressTime(); g2.setRenderingHints(new RenderingHints( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); g2.setColor(color); if (mpt < 1000) { waveSize = (int) (mpt / 7.5); } else { waveSize = 0; } g2.setStroke(new BasicStroke(3)); g2.drawOval(MouseLoc.x - (waveSize / 2), MouseLoc.y - (waveSize / 2), waveSize, waveSize); g2.drawOval(MouseLoc.x - ((waveSize / 2) / 2), MouseLoc.y - ((waveSize / 2) / 2), waveSize / 2, waveSize / 2); } public void Draw(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHints(new RenderingHints( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); drawWave(g2, Color.BLACK); drawTrail(g2); drawMouse(g2); } } // </editor-fold> //ENDCOPY }
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Symbol Dump for Discord
8 hours ago | 0.41 KB
tes
11 hours ago | 0.02 KB
Untitled
1 day ago | 2.28 KB
GSA NS
1 day ago | 1.37 KB
WaterFul.m
MatLab | 1 day ago | 0.42 KB
WaterEmpty.m
MatLab | 1 day ago | 0.54 KB
Spinning.m
MatLab | 1 day ago | 0.53 KB
Drying.m
MatLab | 1 day ago | 0.48 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!