EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
JavaBoBy: ishkur88 - Date Submitted: 2008-09-13 12:57:38 package ircbot; /** * JavaBot (version 1.2) * * MIT License, dydx (Josh Sandlin) <dydx@thenullbyte.org> * */ import java.io.*; import java.net.*; import java.util.regex.*; import java.util.Date; public class Main { { //connection variables String server = "irc.snappeh.com"; String channel = "#enigmagroup"; int port = 6667; //for security try { //our socket we're connected with //out output stream //our input stream //authenticate with the server bw.write( "NICK " + nick + "\n" ); bw.write( "USER " + login + " thenullbyte.org JB: Java Bot\n" ); bw.flush(); //join a channel bw.write( "JOIN " + channel + "\n" ); bw.write( "PRIVMSG " + channel + " :Whats up everybody?\n" ); bw.flush(); System. out. println( "Successfully connected to IRC" ); while( ( currLine = br.readLine() ) != null ) { //checks for PING, if one is found; return a PONG Pattern pingRegex = Pattern.compile( "^PING", Pattern.CASE_INSENSITIVE ); Matcher ping = pingRegex.matcher( currLine ); if( ping.find() ) { bw.write( "PONG " + channel + "\n" ); bw.flush(); } //check for ownership Pattern checkOwner = Pattern.compile( "^:"+owner, Pattern.CASE_INSENSITIVE ); Matcher ownership = checkOwner.matcher( currLine ); //!exit - quit current irc room Pattern exitRegex = Pattern.compile( "!exit", Pattern.CASE_INSENSITIVE ); Matcher exit = exitRegex.matcher( currLine ); if( exit.find() && ownership.find() ) { bw.write( "PRIVMSG " + channel + " :Bye Bye\n" ); bw.write( "PART " + channel + "\n" ); bw.flush(); irc.close(); } //!time - return current time Pattern timeRegex = Pattern.compile( "!time", Pattern.CASE_INSENSITIVE ); Matcher time = timeRegex.matcher( currLine ); if( time.find() && ownership.find() ) { bw.write( "PRIVMSG " + channel + " :" + d +"\n" ); bw.flush(); } //!sayhi - shows a little message saying hello Pattern helloRegex = Pattern.compile( "!sayhi", Pattern.CASE_INSENSITIVE ); Matcher hello = helloRegex.matcher( currLine ); if( hello.find() && ownership.find() ) { bw.write( "PRIVMSG " + channel + " :Hi, I'm a JavaBot. I was coded by dydx in Java!\n"); bw.flush(); } //!join <room> - changes to a new room and sets the variables accordingly Pattern joinRegex = Pattern.compile( "!join", Pattern.CASE_INSENSITIVE ); Matcher join = joinRegex.matcher( currLine ); if( join.find() && ownership.find() ) { String[] token = currLine. split( " " ); bw.write( "PRIVMSG " + channel + " :Im going over to " + token[4] + "\n" ); bw.write( "PART " + channel + "\n" ); channel = token[4]; bw.write( "JOIN " + channel + "\n" ); bw.flush(); } //just to be mean ;) Pattern howDoI = Pattern.compile( "how do i", Pattern.CASE_INSENSITIVE ); Matcher how = howDoI.matcher( currLine ); if( how.find() ) { bw.write( "PRIVMSG " + channel + " :just fucking google it...\n" ); bw.flush(); } Pattern whyRegex = Pattern.compile( "why", Pattern.CASE_INSENSITIVE ); Matcher why = whyRegex.matcher( currLine ); if( why.find() ) { bw.write( "PRIVMSG " + channel + " :DONT ASK QUESTIONS!\n" ); bw.flush(); } } System. err. println( "No such host" ); System. err. println( "There was an error connecting to the host" ); } } }
|
| Return to
java category list |
|
|
Who Visited EnigmaGroup Today?
1563 Guests, 265 Users (178 Spiders)
TheHarrisonW, lonely.connection, IvanDimitriev, 2142, CloverCipher, 2345, Hessesian, vnd, suetekh, Distorted, aurena, Rex_Mundi, m0rt, 3ntr0py, rospark, valy1177, whisperer, Blavatsky, lotato, nmobin27, learning, st3alth, Partisan, hackaday, K0gller, fitz, DrOptix, Jayjay, JohnMalkovitzch, psychomarine, whoami, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, BillTuer, Psiber_Syn, Klosse, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, GothicLogic, strudels, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, trueorfalse, Sir D. Naut, zach, batsbargy, Rik, Macabre, ellisp, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, limited, Nikhil, evjfvir967nj, blackknight911, Mod777, dark_void, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, riesenjoe, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, NIGHTWOLF, m4f10, Vengeance987, avacraft, Bumpadjuppy, becool, thecoder, ddxc, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, RomeoG, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, advilapyday, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, Xendz, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo, howisthechicken, thethird3y3, Somethingclever, marplusz, MSI52, twink gay cam dUi8D, temoJessy |
| |
|
|
|
|
|