Advertisement
KingOfVC

socket shit

Aug 3rd, 2015
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. function ConnMain(data)
  2. {
  3. local raw = split( data, "\r\n" );
  4. local a, z = raw.len(), Data;
  5. for ( a = 0; a < z; a++ )
  6. {
  7. Data = raw[a];
  8. local params = split( Data, " " );
  9. if ( params[ 0 ] == "PING" ) {Sock.Send( "PONG " + params[ 1 ] + "\n" ); Sock.Send( "NAMES :#" + EchoChannel + "\n" ); Sock.Send( "PONG " + params[ 1 ] + "\n" ); Sock.Send( "NAMES :#" + AdmChannel + "\n" );Sock.Send( "NAMES :#" + R_Channel + "\n" )}
  10. }
  11. }
  12.  
  13. function ConnFunc()
  14. {
  15. print("Connected!");
  16. Sock.Send("USER ProsuBot 0 * : The ProsuBot \n");
  17. Sock.Send("NICK ProsuBot \n");
  18. Sock.Send("join #Aaron\n");
  19. }
  20.  
  21. function LostFunc()
  22. {
  23. print("Couldn't connect to the server.");
  24. }
  25.  
  26. function onScriptLoad()
  27. {
  28. Sock <- NewSocket("ConnMain");
  29. Sock.Connect("91.121.134.5", 6667);
  30. Sock.SetNewConnFunc("ConnFunc");
  31. Sock.SetLostConnFunc("LostFunc");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement