/* This core is loaded if no Bot state has been saved (ai.dat) This gives the bot the ability to connect to a Channel and received orders. Orders such as modify nodes, and save the state to be loaded next time. */ /* This is a annotation handled by the bot to set up varribles, This prevents the varribles being reset everytime the * function is executed * note: annotation may not have any comments before or after it. Also the path is reletive to the main java class. */ //@varribles bootcore/varrible.ini function run() { print(command.command+newLine); if(command.command == "NOTICE AUTH") { auth++; } if(auth==4){ auth++; print("Log in!" + newLine); raw("USER " + config.BOTNAME + " " + config.BOTNAME + " " + config.BOTNAME + " :" + config.BOTNAME); raw("NICK " + config.BOTNAME); } if(command.command == "MODE") { print("Join!" + newLine); join("#bottest"); } if(command.command=="PRIVMSG") { print(command.nick + ": " + command.trailing + newLine); processmsg(command.nick,command.trailing); } if(command.command.toLowerCase().equals("PING")) { raw("PONG :" + command.trailing); print("PONG :" + command.trailing+newLine); } if(command.command=="JOIN") { if(command.nick.equals(config.BOTNAME)) { print("I have joined " + command.trailing+newLine); }else{ print(command.nick + " has joined " + command.trailing + newLine); } } if(command.command=="PART") { if(command.nick.equals(config.BOTNAME)) { print("I have left " + command.params[0] + newLine); }else{ print(command.nick + " has left " + command.params[0]+newLine); } } if(command.command=="433") //Username in use? Ok, Change my name then XD { namefail++; raw("USER " + config.BOTNAME + namefail + " " + config.BOTNAME+ namefail + " " + config.BOTNAME+ namefail + " :" + config.BOTNAME); raw("NICK " + config.BOTNAME+ namefail); } } function raw(out) { connection.send_raw(out+newLine); } function join(channel) { raw("JOIN "+channel); } function part(channel) { raw("PART "+channel); } function sendmsg(to,message) { raw("PRIVMSG " + to + " :" + message); } function processmsg(from,msg) { print(msg.trim().substr(0,5) + newLine); if( if(msg.trim().substr(0,6).toLowerCase().equals("~owner")) { if(command.params[0].substr(0,1).equals("#")) { sendmsg(command.params[0],"You may not gain ownership in public"); }else{ if(owner.equals("") && command.trailing.substr(7).toLowerCase().equals("sim7225")) { sendmsg(command.nick,"Access Granted!"); owner = command.user + "@" + command.host; //Hostmask }else{ sendmsg(command.nick,"Access Denied!"); } } } }