-
Posts
539 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by Wizard
-
Ah, this topic again.. too bad my friend, vets are no longer have their value as they used to. Good luck tho ;)
-
The plot for the episodes can be found down in spoiler! have fun
-
I would like to see :wiz: here are some suggestions:
-
What is your favorite part of being moderator ? PS: can you change my username to Maldesto?
-
"Asma3 oktol al bot!" lmfaoooooooooooooo
-
You know, deep down, you want me to be the next CBA! make it happen, make the chatbox great again, #Wizard2k16
-
kys anime lovers!
-
GraphicUtilities#drawModel(org.osbot.rs07.Bot bot, java.awt.Graphics2D g, int gridX, int gridY, int z, Model model)
-
\t(tab).. some people just want to watch the world burn
-
OK THIS IS NOT A TUTORIAL, THERE WILL BE NO EXPLINATION..! Ok start by creating a SQL table using this through myPHPAdmin: SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; CREATE TABLE `scriptdata` ( `username` text NOT NULL, `xp` int(11) NOT NULL, `runtime` bigint(255) NOT NULL, `id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ALTER TABLE `scriptdata` ADD PRIMARY KEY (`id`); ALTER TABLE `scriptdata` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; then make a php file call it what ever you want, I called mine validate.php. This file is responsible on validating the data, inserting and updating the database, it can only be accessed through custom useragent which is specified by the user (to prevent others from submitting fake details through browser)! <?php $useragent = "scriptX";//Change this to whatever you want, just make sure it matches w.e you put in javaside! $ua= $_SERVER["HTTP_USER_AGENT"]; if(!preg_match('/'.$useragent.'/', $ua)) { echo"GTFO out of here!"; } else { $database_name = ""; $servername = "localhost";//database host $username = "root";//database username $password = "";//database password $runtime=$gainedXp=$rsn=""; // Create connection $conn = new mysqli($servername, $username, $password, $database_name; // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } if ($_SERVER["REQUEST_METHOD"] == "GET") { $rsn = mysqli_real_escape_string($conn, $_GET["rsn"]); $gainedXp = mysqli_real_escape_string($conn, $_GET["gainedxp"]); $runtime = mysqli_real_escape_string($conn,$_GET["runtime"]); } $sql = "SELECT * FROM scriptdata WHERE `username`='".$rsn."'"; $result = $conn->query($sql); if($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $prevXp= $row["xp"]; $prevTime = $row["runtime"]; $prevXp+= $gainedXp; $prevTime+= $runtime; $sql = "UPDATE scriptdata SET xp=".$prevXp.", runtime=".$prevTime." WHERE `username`='".$rsn."'"; if($conn->query($sql) === TRUE){ echo "DATA WAS UPDATED"; } else { echo "ERROR UPDATING DATA! ". mysqli_error($conn); } } } else { $sql = "INSERT INTO scriptdata(`username`,`xp`,`runtime`) VALUES('".$rsn."',".$gainedXp.",".$runtime.")"; if($conn->query($sql) === TRUE){ echo "DATA INSERTED"; } else { echo "ERROR INSERTING DATA!<br>". mysqli_error($conn); } } } ?> After that, make another php file call it w.e you want, mine is called sig.php. This is the actual file which gonna retrieve the information from the database and display them on a picture! <?php function ftime($time) { $text = ""; $secs = (intval(intval($time) / 1000)); $hrs = $secs / 3600; $m = $secs / 60 % 60; $secs = $secs % 60; if($hrs < 10) { $text.="0".$hrs; } else { $text.=$hrs; } $text.=":"; if($m < 10) { $text.="0".$m; } else { $text.=$m; } $text.=":"; if($sec < 10) { $text.="0".$secs; } else { $text.=$secs; } return $text; } $database_name = ""; $servername = "localhost";//database host $username = "root";//database username $password = "";//database password $sig_file = "sig.png";//signature picture path $font_path = 'bboron.ttf';//font file path $rsn = ""; $conn = new mysqli($servername, $username, $password, $database_name); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } if ($_SERVER["REQUEST_METHOD"] == "GET") { $rsn = mysqli_real_escape_string($conn, $_GET["rsn"]); } $sql = "SELECT * FROM scriptdata WHERE username='".$rsn."'"; $result = $conn->query($sql); if($result->num_rows > 0) { while($row = $result->fetch_assoc()) { //Set the Content Type header('Content-type: image/jpeg'); $xp = $row["xp"]; $runtime = $row["runtime"]; $formated = ftime($runtime); // Create Image From Existing File $pngimage = imagecreatefrompng($sig_file); // Allocate A Color For The Text $black = imagecolorallocate($pngimage, 0, 0, 0); // Print Text On Image //imagettftext(imagefile, text size, ange, x, y, text color, font_file, text); imagettftext($pngimage, 16, 0, 115, 45, $black, $font_path, $rsn); imagettftext($pngimage, 16, 0, 115, 85, $black, $font_path, $xp); imagettftext($pngimage, 16, 0, 115, 124, $black, $font_path, $formated); // Send Image to Browser imagepng($pngimage); // Clear Memory imagedestroy($pngimage); } } else { echo "user does not exist!"; } ?> JUST MAKE SURE TO CHANGE THE INFO OF THE DB, FONT AND IMAGE TO MATCH YOURS! Now to send data from your script use this first declare two variables //Your url private static final String URL = "http://yourwebsite.com/validate.php?"; //put it the same as the one in PHP! private static final String USER_AGENT = "scriptX"; and use this function to send data public static void sendData(String rsn, int xp, long runtime) { String vars = URL + "rsn=" + rsn + "&gainedxp=" + xp + "&runtime=" + runtime; StringBuilder result = new StringBuilder(); URL url; try { url = new URL(vars); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.addRequestProperty("User-Agent", USER_AGENT); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = rd.readLine()) != null) { result.append(line); } System.out.println(result.toString()); rd.close(); } catch (Exception e) { } } And thats all! Few notes, 1) The data only being sent are the username, xp gained and runtime.. you can add more but you have to edit all the files to match your changes. 2) dont judge my php i dont even know that language i just put some code i googled together! 3)Thanks for Xylate for helping me with php. you can see live example : http://scriptme.ga/sig.php?rsn=zezima (Remove if this is against the rules) Have fun!
-
Your reply is way more usefullless than my post!
-
Paint.java class which implements MouseListener and MouseMotionListener classes that allow us to handle mouse events import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.imageio.ImageIO; public class Paint implements MouseListener, MouseMotionListener { private int x; private int y; public Rectangle misc; public Rectangle stats; public Rectangle drag; public int draggedFromX = 0; public int draggedFromY = 0; public String status = "Idle"; public String antiban = "Idle"; public boolean showMisc = false; public boolean showStats = false; public boolean canDrag = false; public final Color color1 = new Color(36, 36, 36); public final Color color2 = new Color(103, 103, 103); public final Color color3 = new Color(103, 103, 103, 150); public final Color color4 = new Color(0, 102, 255); public final Color color5 = new Color(76, 76, 76, 100); public final Color color6 = new Color(255, 255, 255, 30); public final Color color7 = new Color(255, 255, 255); public final Color color8 = new Color(255, 255, 255, 40); public final BasicStroke stroke1 = new BasicStroke(1); public final Font font1 = new Font("Arial", 0, 9); public final Font font2 = new Font("Arial", 0, 10); public final Font font3 = new Font("Arial", 0, 12); public BufferedImage img1; public BufferedImage img2; public BufferedImage normal = null; public BufferedImage clicked = null; public Paint() { x = 261; y = 343; try { final URL cursorURL = new URL("http://i596.photobucket.com/albums/tt47/QaRTooN_/normal.png"); final URL cursor80URL = new URL("http://i596.photobucket.com/albums/tt47/QaRTooN_/clicked-1.png"); normal = ImageIO.read(cursorURL); clicked = ImageIO.read(cursor80URL); img1 = ImageIO.read(new URL("http://i596.photobucket.com/albums/tt47/QaRTooN_/reports-1.png")); img2 = ImageIO.read(new URL("http://i596.photobucket.com/albums/tt47/QaRTooN_/stats.png")); } catch (IOException e) { } } public void draw(Graphics g1) { Graphics2D g = (Graphics2D) g1; misc = new Rectangle(x + 3, y + 3, 27, 25); stats = new Rectangle(x + 31, y + 3, 27, 25); drag = new Rectangle(x + 4, y + 31, 258, 12); g.setColor(color1); g.fillRect(x, y, 258, 47); g.setColor(color2); g.setStroke(stroke1); g.drawRect(x + 1, y + 1, 255, 44); g.setColor(color3); g.setStroke(stroke1); g.draw(misc); g.setStroke(stroke1); g.draw(stats); g.drawRect(x + 61, y + 3, 193, 25); g.drawRect(x + 3, y + 31, 251, 12); if (showMisc == true) { g.setColor(color4); g.fillRect(x + 4, y + 4, 26, 24); } if (showStats == true) { g.setColor(color4); g.fillRect(x + 32, y + 4, 26, 24); } g.setColor(color4); g.fillRect(x + 62, y + 4, 50, 24); g.drawImage(img1, x + 5, y + 5, null); g.drawImage(img2, x + 34, y + 5, null); g.setColor(color6); g.fillRect(x, y + 30, 258, 8); g.setColor(color6); g.fillRect(x, y, 258, 17); g.setFont(font1); g.setColor(color7); g.drawString("Made by Wizard!", x + 83, y + 41); g.setFont(font2); g.drawString("3% to ", x + 121, y + 19); if (showMisc == true) { g.setColor(color1); g.fillRect(x, y - 104, 160, 104); g.fillRect(x + 1, y - 103, 157, 101); g.setColor(color2); g.drawRect(x + 1, y - 103, 157, 101); g.setColor(color8); g.fillRect(x, y - 104, 160, 59); g.setColor(color7); g.drawString("Status : " + status, x + 6, y - 71); g.drawString("Anti-Ban : " + antiban, x + 6, y - 58); g.drawString("Run Time : " , x + 6, y - 45); g.drawString("W.e : ", x + 6, y - 32); g.drawString("W.e : ", x + 6, y - 19); g.drawString("Profit : ", x + 6, y - 6); g.setFont(font3); g.drawString("Miscellaneous :-", x + 5, y - 87); } if (showStats == true) { g.setColor(color1); g.fillRect(x, y - 104, 160, 104); g.fillRect(x + 1, y - 103, 157, 101); g.setColor(color2); g.drawRect(x + 1, y - 103, 157, 101); g.setColor(color8); g.fillRect(x, y - 104, 160, 59); g.setFont(font2); g.setColor(color7); g.drawString("Exp Gained : ", x + 6, y - 71); g.drawString("Current Exp : ", x + 6, y - 58); g.drawString("Exp TNL : ", x + 6, y - 45); g.drawString("Exp/Hour : ", x + 6, y - 32); g.drawString("Start Level : ", x + 6, y - 19); g.drawString("Current Level : ", x + 6, y - 6); g.setFont(font3); g.drawString("Stats :-", x + 5, y - 87); } } @[member='Override'] public void mousePressed(MouseEvent e) { if (drag.contains(e.getPoint())) { canDrag = true; draggedFromX = e.getX() - x; draggedFromY = e.getY() - y; } if(misc.contains(e.getPoint())) { if(showStats) showStats=false; showMisc = !showMisc; } if(stats.contains(e.getPoint())) { if(showMisc) showMisc = false; showStats = !showStats; } } @[member='Override'] public void mouseReleased(MouseEvent arg0) { canDrag = false; } @[member='Override'] public void mouseDragged(MouseEvent e) { if (canDrag) { int newX = 0; int newY = 0; newX = e.getX() - draggedFromX; newY = e.getY() - draggedFromY; x = newX; y = newY; } } @[member='Override'] public void mouseMoved(MouseEvent e) { // TODO Auto-generated method stub } @[member='Override'] public void mouseClicked(MouseEvent arg0) { // TODO Auto-generated method stub } @[member='Override'] public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } @[member='Override'] public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } } you can change to your preferred paint position x = 261; y = 343; Now in your main class which extends Script, declare global Paint object Paint paint; in onStart add the following lines paint = new Paint();//initiate paint Object this.bot.getCanvas().addMouseMotionListener(paint);//Register paint object as mouse motion listener this.bot.addMouseListener(paint);//register paint object as mouse listener in onExit add the following to remove the listeners this.bot.removeMouseListener(paint); this.bot.getCanvas().removeMouseMotionListener(paint); and in onPaint add the following line paint.draw(arg0); //arg0 being the onDraws Graphics2D parameter TO DRAG THE PAINT YOU HAVE TO HOLD YOUR MOUSE IN THE RECTANGLE WHERE Made by Wizard is written, that is the drag area! and thats all! here a picture of the results After being dragged to another location: Special thanks for FrostyBug for telling me about the motion part >.> Enjoy!
-
naananana nananana hey hey hey GOOD BYE!
-
Together we gonna make Osbot Great Again
-
Fuck Khaleesi overrated.. anyway Jon is not a bastard and R+L=J is confirmed
-
Seems to me like a promising project!! good luck and I hope to see something like this implemented into scripts