Advertisement
Aha2Y

SocketBot + Dialog V2

Nov 30th, 2011
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 5.99 KB | None | 0 0
  1. dialog socketmain {
  2.   title "Socket Engine by DutchTech Technology."
  3.   size -1 -1 627 485
  4.   tab "Home", 1, 0 0 628 459  tab "Home", 1, 0 0 628 459
  5.   tab "Settings", 9
  6.   text "Socket engine by DutchTech Technology (Version 1.0)", 2, 166 462 282 16
  7.   list 3, 16 38 584 380, tab 1 vsbar
  8.   button "Connect", 4, 44 418 66 24, tab 1
  9.   button "Disconnect", 5, 136 418 66 24, tab 1
  10.   button "Kill socket", 6, 490 416 66 24, tab 1
  11.   button "Reconnect", 7, 400 416 64 24, tab 1
  12.   edit "", 8, 490 460 100 20, read
  13.   edit "", 10, 59 40 134 20, tab 9
  14.   text "NickName", 11, 6 40 48 16, tab 9
  15.   text "User ID", 12, 8 68 40 16, tab 9
  16.   edit "", 13, 58 96 134 20, tab 9
  17.   text "RName", 14, 8 98 44 18, tab 9
  18.   edit "", 15, 59 68 134 20, tab 9
  19.   button "Update", 22, 266 420 74 24, tab 9
  20.   text "Server", 16, 210 38 42 18, tab 9
  21.   edit "", 17, 256 38 116 20, tab 9
  22.   text "Port", 18, 267 65 26 16, tab 9
  23.   edit "", 19, 294 65 46 20, tab 9
  24.   text "Alt Nick", 20, 8 126 56 18, tab 9
  25.   edit "", 21, 58 126 134 20, tab 9
  26.   text "QuitMsg", 27, 390 38 48 17, tab 9
  27.   edit "", 28, 446 38 169 20, tab 9
  28.   edit "", 34, 10 458 134 22, read
  29.   menu "Socket Control", 29
  30.   item "Connect", 30, 29
  31.   item "Disconnect", 31, 29
  32.   item break, 33, 29
  33.   item "Kill Socket", 33, 29
  34. }
  35. dialog socket_about {
  36.   title "About this script"
  37.   size -1 -1 231 241
  38.   option pixels
  39.   button "Ok(Cancel)", 1, 79 189 65 25, cancel
  40.   edit "Thanks for using this script!  :)              This script is OpenSource in any way. But if you edit it i can tell you this script is not for a begginer in mIRC Scripting Language..                                            If you have paid for this script then you probaly got scammed and you should ask back your money!", 2, 10 60 206 125, multi
  41.   text "About Socket Engine", 3, 62 23 100 17
  42.   text "Script by DutchTech Technologies", 4, 33 222 176 17
  43. }
  44.  
  45. on *:dialog:socketmain:*:*: {
  46.   if ($devent == init) {
  47.     if ($readini(socket.ini,general,nickname) != $null) { did -caur socketmain 10 $readini(socket.ini,general,nickname) }
  48.     if ($readini(socket.ini,general,ident) != $null) { did -caur socketmain 15 $readini(socket.ini,general,ident) }
  49.     if ($readini(socket.ini,general,realname) != $null) { did -caur socketmain 13 $readini(socket.ini,general,realname) }
  50.     if ($readini(socket.ini,general,altnick) != $null) { did -caur socketmain 21 $readini(socket.ini,general,altnick) }
  51.     if ($readini(socket.ini,connect,server) != $null) { did -caur socketmain 17 $readini(socket.ini,connect,server) }
  52.     if ($readini(socket.ini,connect,port) != $null) { did -caur socketmain 19 $readini(socket.ini,connect,port) }
  53.     if ($readini(socket.ini,general,quitmsg) != $null) { did -caur socketmain 28 $readini(socket.ini,general,quitmsg) }
  54.     if ($readini(socket.ini,general,update) != $null) { did -caur socketmain 34 Socket ready. }
  55.   }
  56.   if ($devent == sclick) {
  57.     if ($did == 4) { sockopen socketbot $readini(socket.ini,connect,server) $readini(socket.ini,connect,port) | did -caur socketmain 8 Connecting... }
  58.     if ($did == 5) { sockwrite -nt socketbot QUIT : $+ $readini(socket.ini,general,quitmsg) | did -caur socketmain 8 Disconnected. }
  59.     if ($did == 6) { sockclose socketbot | did -caur socketmain 8 Disconnected. }
  60.     if ($did == 7) { sockwrite -nt socketbot QUIT : $+ $readini(socket.ini,general,quitmsg)  | sockopen socketbot $readini(socket.ini,connect,server) $readini(socket,connect,port) }
  61.     if ($did == 22) { updateconfig }
  62.   }
  63.   if ($devent == close) { if ($sock(socketbot).status == $false) { sockwrite -nt socketbot QUIT : $+ $readini(socket.ini,general,quitmsg) (Dialog Closed)  } }
  64.   if ($devent == menu) {
  65.     if ($did == 30) { sockopen socketbot $readini(socket.ini,connect,server) $readini(socket.ini,connect,port) | did -caur socketmain 8 Connecting...  }
  66.     if ($did == 31) { sockwrite -nt socketbot QUIT : $+ $readini(socket.ini,general,quitmsg) | did -caur socketmain 8 Disconnected. }
  67.     if ($did == 32) { sockwrite -nt socketbot QUIT : $+ $readini(socket.ini,general,quitmsg) | sockopen socketbot $readini(socket.ini,connect,server) $readini(socket.ini,connect,port) | did -caur socketmain 8 Reconnecting.. }
  68.   }
  69. }
  70.  
  71. on *:SOCKOPEN:socketbot: {
  72.   sockwrite -nt $sockname USER $readini(socket.ini,general,ident) $readini(socket.ini,general,nickname) $readini(socket.ini,general,nickname) : $+ $readini(socket.ini,general,realname)
  73.   sockwrite -nt $sockname NICK $readini(socket.ini,general,nickname)
  74.   sockwrite -nt $sockname JOIN #DutchTech
  75. }
  76.  
  77. on *:SOCKREAD:socketbot: {
  78.   var %buffer
  79.   sockread -f %buffer
  80.   tokenize 32 %buffer
  81.   autoscroll socketmain 3
  82.   did -cau socketmain 3 %buffer
  83.   if ($1 = PING) { sockwrite -n $sockname PONG $2 }
  84.   if (*motd* iswm %buffer) { sockwrite -nt $sockname JOIN #DutchTech | did -caur socketmain 8 Connected }
  85.   if ((@help == $text($4)) && ($5 == $null)) { sockwrite -nt socketbot PRIVMSG $3 : $+ $nick $+ :  Admin, Calc }
  86.   if ((@help == $text($4)) && ($5 == admin)) { sockwrite -nt socketbot PRIVMSG $3 : $+ $nick $+ : Disconnect, Identify, Join, Part, Restart }
  87.   if ((@help == $text($4)) && ($5 == calc)) { sockwrite -nt socketbot PRIVMSG $3 : $+ $nick $+ : Calc is a calculator (Example: @calc 1+1) }
  88.   if (@calc == $text($4)) { sockwrite -nt socketbot PRIVMSG $3 : $+ $nick $+ : $text($5) $+ = $+ $calc($text($5) )  }
  89.  
  90. }
  91.  
  92. alias -l text { return $remove($1,:) }
  93. alias -l autoscroll { if ($did($1,$2).lines) { did -c $1- $v1 | did -u $1- $v1 } }
  94. alias socketbot { dialog -md socketmain socketmain | did -cau socketmain 8 Disconnected }
  95. alias -l sockpriv { sockwrite -nt socketbot PRIVMSG $1- }
  96. alias -l updateconfig {
  97.   writeini socket.ini general nickname $did(10)
  98.   writeini socket.ini general ident $did(15)
  99.   writeini socket.ini general realname $did(13)
  100.   writeini socket.ini general altnick $did(21)
  101.   writeini socket.ini connect server $did(17)
  102.   writeini socket.ini connect port $did(19)
  103.   writeini socket.ini general quitmsg $did(28)
  104.   did -caur socketmain 34 Rewriting config
  105.   .timer 1 2 did -caur socketmain 34 Config updated
  106. }
  107.  
  108.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement