highfi5e Pluto Player
Posts : 32 PlutoPoints : 370 Join date : 2011-05-09
| Subject: James/ Relapse's Coder app Tue May 10, 2011 7:28 pm | |
| Name:James
Age:17
Timezone:GMt 9+
How many hours you can be on a day:35 weekdays 12+ weekends on wenesdays i have a coding class so not that day
Have you ever Coded in any other servers? If so, please give proof: [You must be registered and logged in to see this link.] and thats itGive me an example of an NPC Script(GOOD ONE!):Gachapon NPC */ prizes=[INSERT, ITEM, IDS, HERE, AS, AN, ARRAY]; // Insert your item ID's here random=Math.floor(Math.random() * prizes.length++); var chunkymonkey=0;
function start() { cm.sendYesNo("Would you like to use your Gachapon Ticket?"); }
function action(m,t,s){ cm.dispose(); if(m<1){ cm.dispose(); }else{ chunkymonkey++; } if(chunkymonkey==1){ if(cm.haveItem(5220000,1)){ // edit this item ID to whatever you want (I used the reg gachapon ticket) cm.gainItem(prizes[random],1); cm.gainItem(5220000,-1); // if you changed the above ID, make sure you change this one too }else{ cm.sendOk("Come back when you have a Gachapon Ticket"); cm.dispose(); } }else{ cm.sendOk("Come back when your ready to take a chance at fortune!"); cm.dispose(); } } Give me an example of a MYSQL Script(GOOD ONE!): # queries the books table in database wbluhm on multivac
use DBI; use strict;
my ($dsn) = "DBI:mysql:wbluhm:multivac.sdsc.edu"; # data source name my ($user_name) = "wbluhm"; # user name my ($password) = ""; # password my ($dbh, $sth); # database and statement handles my (@ary); # array for rows returned by query
# connect to database $dbh = DBI->connect ($dsn, $user_name, $password, { RaiseError => 1 });
# issue query my $query = qq{ SELECT title, author, comment FROM books WHERE topic="Java" }; $sth = $dbh->prepare ( $query ); $sth->execute ();
# read results of query, then clean up while (@ary = $sth->fetchrow_array ()) { print join (" | ", @ary), "\n"; } $sth->finish ();
$dbh->disconnect (); exit (0);
Java Example: JavaBooks.java // queries the books table in database wbluhm on multivac
import java.sql.*; public class JavaBooks { public static void main(String[] args) {
try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); } catch (Exception E) { System.err.println("Unable to load driver"); E.printStackTrace(); }
try { Connection C = DriverManager.getConnection( "jdbc:mysql://multivac.sdsc.edu/wbluhm","wbluhm",""); Statement Stmt = C.createStatement();
ResultSet RS = Stmt.executeQuery ("SELECT title, author, comment " + " FROM books WHERE topic=\"Java\"");
while (RS.next()) { System.out.print("\"" + RS.getString(1) + "\""); System.out.print(" by " + RS.getString(2)); System.out.println(": " + RS.getString(3)); } C.close(); RS.close(); Stmt.close(); } catch (SQLException E) { System.out.println("SQLException: " + E.getMessage()); System.out.println("SQLState: " + E.getSQLState()); System.out.println("VendorError: " + E.getErrorCode()); } } }
Do you have any GM experience? You may need it for GM'ing and Coding: i was a GM on this server lol i was demoted but im ready to retry coding | |
|