Reaper_20

Oasiz IRCX Socket

Mar 1st, 2015 (edited)
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 22.18 KB | None | 0 0
  1. -----------------------------------------------------------------------
  2. Thanks Rob for the peice's of socket coding I used to make this Possible.
  3. And Also the updater coding. I may add to this in the future.
  4. -----------------------------------------------------------------------
  5. :::::::::::Main Socket::::::::::
  6. on *:sockopen:oa.sock.*: {
  7.   dosock $sockname IRCVERS IRC9 OASIZ-WEBC!2.05.15.069 $crlf
  8.   dosock $sockname AUTH $iif(%DOPASSPORT,GateKeeperPassport,GateKeeper) I :GKSSP000000X1A
  9.   dosock $sockname user web * * : $+ webc[2.05.15.065.]
  10. }
  11.  
  12. on *:sockread:oa.sock.*: {
  13.   var %o | sockread %o | tokenize 32 %o
  14.   $sock_trace(<- $1-)
  15.  
  16.   if ($1 == PING && $2) {
  17.     dosock $sockname PONG $2-
  18.   }
  19.   if ($1 $3 === AUTH S) {
  20.     if ($4 === :OK) {
  21.       if (%DOPASSPORT) {
  22.         dosock $sockname AUTH GateKeeperPassport S : $+ %_oa.authcode
  23.       }
  24.       else {
  25.         dosock $sockname NICK Guest_ $+ $rand(000,999)
  26.       }
  27.     }
  28.     else {
  29.       set %_oa.challengeType 0 | set %_oa.challengeCode 0
  30.       $oaGo(2, $remove($4,:GKSSP000000))
  31.       .timer. $+ $sockname 0 1 challenge_code_check $sockname
  32.     }
  33.   }
  34.   elseif ($2 == JOIN) {
  35.     dosock oa.local $1 $2 $4 | $iif($right($gettok($1,1,33),-1) == $mnick,$null,echo $right($4,-1) 9 $right($1,-1) Has Joined the Chatroom. ))
  36.     if ($gettok($3,4,44)) dosock oa.local : $+ $right($4,-1) MODE $right($4,-1) + $+ $replace($gettok($3,4,44),+,v,@,o,.,q) $right($gettok($1,1,33),-1)
  37.   }
  38.  
  39.   elseif ($2 == 353) {
  40.     var %num = 6 | while (%num <= $numtok($1-,32)) { var %x = %x $iif(%num = 6,:) $+ $gettok($gettok($1-,%num,32),-1,44) | inc %num | dosock oa.local $1-5 %x }
  41.   }
  42.  
  43.   elseif ($2 == Privmsg) { Var %nick = $right($gettok($1,1,33),-1)
  44.     if ($4 == :ACTION) { echo 6 $3 * $right($gettok($1,1,33),-1) $5- }
  45.     elseif (!roll isin $right($oa_fnt($4),-1)) { set %die $5 | set %side $6 | if ($chr(43) isin $7) set -u2 %stat $7 | set %dice.nick $right($gettok($1,1,33),-1) | chan.list | if (%msg.st == $true) { $iif($3 isin %roll.channels,set %msg.chan /msg $3,unset %msg.chan)) | roll } | if (%msg.st == $false) { $iif($3 isin %roll.channels,set %msg.user /raw -q privmsg $3,unset %msg.user)) | roll } }
  46.     elseif (%nick isowner $3) { echo $3 8• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
  47.     elseif (%nick isop $3) { echo $3 05• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
  48.     elseif (%nick == $mnick) { echo 12 $3 05• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
  49.     elseif (%nick isvoice $3) { echo $3 3• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
  50.     elseif (%nick isreg $3) { echo $3 • $replace(%nick,>,Guest_) $+ : 12 $oa_fnt($right($4-,-1)) }  
  51.     else { echo $3 10The chat's onjoin is: 4 $right($4-,-1) }
  52.   }
  53.   elseif ($2 == PART) { dosock oa.local %o | if ($4-) var %p.reason $chr(40) $+ $right($4-,-1) $+ $chr(41) | $iif($right($gettok($1,1,33),-1) == $mnick,$null,echo $3 10 $right($1,-1) Has left the Chatroom. %p.reason )) | if ($dialog(Nicklist)) /xdid -r Nicklist 1 | nicks }
  54.   elseif ($2 == PROP) { set -u15 %prop $4 | $iif(%prop == OWNERKEY,writeini -n user.accounts.ini $3 q.pass $right($5,-1),$null)) | $iif(%prop == hostkey,writeini -n user.accounts.ini $3 h.pass $right($5,-1),$null)) | Echo $3 10 Host $right($1,-1) Has set the $4 to 4 $right($5-,-1) }
  55.   elseif ($2 == 332) { echo $4 10 $+ The chat's topic is: 4 $right($5-,-1) }
  56.   elseif ($2 == 464) { $iif(%q.pass,remini user.accounts.ini $active q.pass,remini user.accounts.ini $active h.pass )) }
  57.   elseif ($4 == 471) { echo 15 $3 $right($1,-1) is attempting to join but $3 is at Max Limit | set -u15 %k.chan $3 | knock.fl } | elseif ($4 == 473) { echo 15 $3 $right($1,-1) is attempting to join but $3 is set to Invite Only | set -u15 %k.chan $3 | knock.fl }
  58.   elseif ($4 == 474) { echo 15 $3 $right($1,-1) is attempting to join $3 but $right($gettok($1,1,33),-1) is Banned | set -u15 %k.chan $3 | knock.fl } | elseif ($4 == 475) { echo 15 $3 $right($1,-1) is attempting to join but $3 Requires key to enter | set -u15 %k.chan $3 | knock.fl }
  59.   elseif ($2 == 804) { did -a accesslist 1 $remove($gettok($1-,5-20,32),:)) }
  60.   elseif ($2 == 812) { /echo @channelist 4 $+ $4 $chr(32) 12 $5 $chr(32) $6 $chr(32) $remove($7-40,$chr(58)) | halt }
  61.   elseif ($2 == 818) { if ($5 == PUID) url -an http://www.oasiz.net/forum/?showuser= $+ $right($6,-1) }
  62.   elseif ($2 == MODE) { dosock oa.local %o | var %mask = *! $+ $gettok($gettok($1,2,33),1,64)), %nick = $right($gettok($1,1,33),-1)) | if ($4 == +q) && ($5 == $mnick) { var %qmask = *! $+ $gettok($ial($5).addr,1,64) | access $3 add OWNER %qmask } | if ($4 == +o) && ($5 == $mnick) { var %omask = *! $+ $gettok($ial($5).addr,1,64) | access $3 add HOST %omask }
  63.     if ($2 == MODE) && ($3 == $mnick) { goto done }
  64.     if ($4 == -o) && ($5 == $mnick) && ($group(#deop.prot) == on) { var %h.pass $readini(user.accounts.ini,$3,h.pass) | $iif(%h.pass,.pass $3 %h.pass,/hop $3)) | kick $3 %nick No deoping me | access $3 delete host *! $+ $gettok($1,2,33) | access $3 delete host %mask | access $3 add deny %mask 600 }
  65.     if ($4 == -q) && ($5 == $mnick) && ($group(#deowner.prot) == on) { var %q.pass $readini(user.accounts.ini,$3,q.pass) | $iif(%q.pass,.pass $3 %q.pass,/hop $3)) | kick $3 %nick User Mode change detected | access $3 delete owner *! $+ $gettok($1,2,33) | access $3 delete owner %mask | access $3 add deny %mask | /prop $3 ownerkey $r(1,1000) $+ $r(1,1000) $+ $r(1,1000) $+ $r(1,1000) }
  66.     if (v isin $4) || (q isin $4) || (o isin $4) { Echo $3 14 $right($1,-1) Has set mode $4 $5 $ial($5).addr | goto end } | if (+ isin $4) { echo $3 14 $right($1,-1) Has changed channel mode $4 } | if (- isin $4) { echo $3 14 $right($1,-1) Has changed channel mode $4 | :end }
  67.     :done
  68.   }
  69.   elseif ($2 == 821) { set -u10 %nick $right($gettok($1,1,33),-1),1)) | $iif(%mark.nick,$null,set -u10 %mark.nick %nick)) | $iif(%user.chan,$null,set -u10 %user.chan $comchan($right($gettok($1,1,33),-1),1))) | set %mark.chan $comchan($right($gettok($1,1,33),-1),1))) | echo %mark.chan 4 $right($1,-1) Has been marked as returned | if (%aw.fl.prot == on) { /away.fl } } | elseif ($2 == 822) { set -10 %nick $right($gettok($1,1,33),-1),1)) | $iif(%user.chan,$null,set -u15 %user.chan $comchan($right($gettok($1,1,33),-1),1))) | set -u10 %mark.chan $comchan($right($gettok($1,1,33),-1),1)) | $iif(%mark.nick,$null,set -u10 %mark.nick %nick)) | echo %mark.chan 4 $right($1,-1) Has been marked as Away | if ($group(aw.fl.prot) == on) { /away.fl } }
  70.  
  71.   elseif ($2 == whisper) {
  72.     var %nick = $right($gettok($1,1,33),-1) | $iif(%whisper. [ $+ [ %nick ] ],$null,userip %nick)) | set -u5 %w.chan $3 | set -u5 %w.nick %nick
  73.     if (\x01ONSCR isin $1-) { echo $3 4 $chr(40) $+ Onscreen Whisper From %nick $+ $chr(41) $chr(58) $oa_fnt($6-) | halt }
  74.     else { window -eokn @Whisper- [ $+ [ %nick ] ] -1 -1 350 200 | echo 12 -t @Whisper- [ $+ [ %nick ] ] $+(,%nick,:)) $oa_fnt($5-) | set %whisper. [ $+ [ %nick ] ] $3 }
  75.   }
  76.  
  77.   elseif ($2 == KICK) { var %nick = $right($gettok($1,1,33),-1) | dosock oa.local %o
  78.     if ($4 == $mnick) {
  79.     echo -s 4 You were kicked out of the chatroom by Host %nick | echo -s 4 Rejoining... | /hop $3 | /kick $3 %nick goodbye | access $3 delete owner *! $+ $ial(%nick).addr | access $3 delete owner *! $+ $gettok($ial(%nick).addr,1,64)) | access $3 add deny *! $+ $gettok($gettok($1,2,33),1,64)) 600 | halt }
  80.     echo 4 $3 Host $right($1,-1) kicked $4 $address($4,1) $right($5-,-1) | haltdef
  81.   }
  82.  
  83.   else {
  84.     $iif($sock(oa.local).status == active,sockwrite -n oa.local %o,/sockclose oa.local /connect))
  85.   }
  86. }
  87.  
  88. :::::::::::Local Socket::::::::::
  89. on *:sockclose:oa.sock.*:{
  90.   sockclose oa.local
  91.   if ($status != disconnected) { disconnect }
  92. }
  93.  
  94. on *:sockread:oasiz*: {
  95.   if ($sockerr > 0) return
  96.   var %z | sockread %z
  97.   while ($sockbr > 0) {
  98.     tokenize 32 %z
  99.     if ($regex($1-,/challenge": "(.*)"/)) { set %_oa.challengeCode $regml(1) | $iif(%_oa.challengeType == 1,.RAW -q AUTH GateKeeperPassport S :GKSSP000000 $+ $regml(1),) | return }
  100.     if ($regex($1-,/authcode": "(.*)"/)) { set %_oa.authcode $regml(1) | echo -s 4 Updating Complete | return }
  101.     if ($regex($1-,/"message": "(.*)"/)) { echo -s 4 Error: $regml(1) | echo -s 4 Updating Failed | return }
  102.     return
  103.   }
  104.   sockread %z
  105. }
  106.  
  107. on *:sockopen:oasiz*: {
  108.   sockwrite -n $sockname GET /api?api_key= $+ %_oa.api_key $+ &access_token= $+ $access_token() $+ &timestamp= $+ %_oa.api_time $+ &api_call= $+ %_oa.api_call $+ &query= $+ %_oa.api_query HTTP/1.1 $+ $crlf $+ host: www.oasiz.net $+ $crlf $+ Connection: close $str($crlf,2)
  109. }
  110.  
  111. on *:socklisten:listen:{
  112.   sockaccept oa.local | sockclose $sockname
  113. }
  114.  
  115. on *:sockread:oa.local:{
  116.   var %x | sockread %x | tokenize 32 %x
  117.   $sock_trace(<- $1-)
  118.   sockwrite -n oa.sock.* %x
  119. }
  120.  
  121. :::::::::::Alias's::::::::::
  122. alias oaGo {
  123.   if ( $1 === 1 ) { set %_oa.api_call ircx_authcode }
  124.   else { set %_oa.api_query $2 | set %_oa.api_call ircx_challenge }
  125.   sockopen -e oasiz $+ $rand(000,999) www.oasiz.net 443
  126. }
  127.  
  128. on ^*:logon:*: { haltdef }
  129.  
  130. alias challenge_code_check {
  131.   if (%_oa.challengeCode != 0) {
  132.     .timer. $+ $1 off
  133.     dosock $1 AUTH $iif(%DOPASSPORT,GateKeeperPassport,GateKeeper) S :GKSSP000000 $+ $+ %_oa.challengeCode
  134.   }
  135. }
  136.  
  137. alias hmacsha1 {
  138.   var %key $1, %data $2
  139.   bset -c &key 1 $regsubex(%key,/(.)/g, $asc(\1) $chr(32))
  140.   bset -c &data 1 $regsubex(%data,/(.)/g, $asc(\1) $chr(32))
  141.   if ($bvar(&key,0) > 64) bset -c &key 1 $hex2chr($sha1(&key,1))
  142.   bset -c &ipad 1 $xorall($str($+(54,$chr(32)),64),$bvar(&key,1-))
  143.   bset -c &opad 1 $xorall($str($+(92,$chr(32)),64),$bvar(&key,1-))
  144.   bcopy &ipad $calc($bvar(&ipad,0) + 1) &data 1 -1
  145.   bset -c &ipad 1 $hex2chr($sha1(&ipad,1))
  146.   bcopy &opad $calc($bvar(&opad,0) + 1) &ipad 1 -1
  147.   bset -c &return 1 $hex2chr($sha1(&opad,1))
  148.   noop $encode(&return, mb)
  149.   $iif($isid,return,$iif(#,say,echo -a)) $bvar(&return, 1-).text
  150. }
  151.  
  152. alias -l hex2chr { return $regsubex($1-,/(.{2})/g, $base(\t,16,10) $chr(32)) }
  153.  
  154. alias -l xorall {
  155.   var %p $1, %k $2, %end $iif($regex($1,/([\d]{1,})/g) > $regex($2,/([\d]{1,})/g),$v1,$v2)
  156.   return $regsubex($str(.,%end),/(.)/g,$+($xor($iif($gettok(%p,\n,32),$v1,0),$iif($gettok(%k,\n,32),$v1,0)),$chr(32)))
  157. }
  158.  
  159. alias access_token {
  160.   set %_oa.api_time $ctime
  161.   var %json $chr(123) $+ "timestamp": $+ %_oa.api_time $+ $chr(125)
  162.   return $md5($hmacsha1(%_oa.api_pass,%json))
  163. }
  164.  
  165. alias oa_fnt { return $regsubex($1-,/S~:.*$/gi,$null) }
  166.  
  167. alias connect {  
  168.   set %DOPASSPORT $true
  169.   .server 127.0.0.1 4000 | socklisten listen 4000
  170.   sockopen oa.sock. $+ $rand(11111,99999) %server.ip 6667
  171.   .timerpingtimeoutck 0 30 /socket_watch
  172. }
  173.  
  174. alias sock_trace {
  175.   if (!$window(@trace)) { /window -e @trace }
  176.   echo @trace $timestamp $1-
  177. }
  178.  
  179. alias sock_close {
  180.   sockclose oa.sock.* | sockclose oa.local
  181. }
  182.  
  183. alias dosock {
  184.   $sock_trace(-> $2-)
  185.   sockwrite -n $1-
  186. }
  187.  
  188. alias socket_watch {
  189.   if ($sock(oa.sock.*).status == active) { halt }
  190.   else { sock_close | connect }
  191. }
  192. alias upd { echo -s 4 Updating passport: %s.account | $oaGO(1) }
  193. alias osw { $iif($snicks,echo # $chr(40) $+ Onscreen whisper to $snicks $+ $chr(41) $1-,echo 4 # Error: Please select a nick from the nicklist)) | if ($snicks) WHISPER $active $snicks :ONSCR $1- }
  194. alias key { set %key. $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) $+ $chr($r(65,200)) | writeini -n user.accounts.ini %c q.pass %key. }
  195. alias knock.fl { set -u15 %knock.watch $calc(%knock.watch + 1) | $iif(%knock.watch >= 5,/mode %k.chan -u,$null)) }
  196. alias away.fl { if (%mark.nick == %nick) { set -u10 %away.watch $calc(%away.watch + 1) } | else { goto end } | if (%away.watch >= 5) /kick %user.chan %mark.nick | if (%away.watch >= 5) /access %user.chan add deny *! $+ $gettok($ial(%mark.nick).addr,1,64)) 15 | :end }
  197. alias account.read { var %anum 0, %alimit 5 | while %anum < %alimit { inc %anum | did -i Options 1 %anum $gettok($readini(user.accounts.ini,account,account $+ %anum),1,32)) } }
  198. alias serv.type { $iif(M isin %serv.type,set %server.ip 96.47.34.246,set %server.ip 96.47.34.241)) }
  199. alias Fav.list {
  200.   var %a $readini(Favorite.ini,%account,chan.count), %b = 0 | set -u60 %channels $readini(Favorite.ini,%account,channels) | set -u20 %j.chans $readini(Favorite.ini,%account,Join)
  201.   while (%b < %a) {
  202.     inc %b
  203.     if ($dialog(Options)) { /did -a Options 11 $chr(37) $+ $chr(35) $+ $gettok(%channels,%b,32))) }
  204.     $iif($dialog(Options),$null,$iif(%j.chans,/join $chr(37) $+ $chr(35) $+ $gettok(%j.chans,%b,32)))
  205.   }
  206. }
  207.  
  208. menu channel {
  209.   .Channel keys
  210.   .owner up $chr(40) $+ $readini(user.accounts.ini,#,q.pass) $+ $chr(41):{ set %q.pass 1 | .pass # $readini(user.accounts.ini,#,q.pass) }
  211.   .host up $chr(40) $+ $readini(user.accounts.ini,#,h.pass) $+ $chr(41):{ unset %q.pass | .pass # $readini(user.accounts.ini,#,h.pass) }
  212.   -
  213.   $iif(($me isop #),$style(0),$style(2)) Accesslist:/dialog -dm accesslist accesslist
  214. }
  215.  
  216. menu nicklist {
  217.   .View Profile:{ /prop $$1 PUID }
  218. }
  219.  
  220. menu menubar,status {
  221.   .Options dialog:{ dialog -dm Options Options }
  222.   .Oasiz Channelist:{ if (!$window(@Channelist)) { /window -e @channelist | listx } }
  223. }
  224.  
  225. :::::::::::Event's::::::::::
  226. on *:disconnect:{ if (%acc.sw == $true) { .timerconn2 1 5 /connect } }
  227. on ^*:rawmode:*:{ haltdef }
  228. on ^*:join:#:{ haltdef }
  229. on ^*:part:#:{ haltdef }
  230. on ^*:kick:#:{ haltdef }
  231. on ^*:TOPIC:#:{ haltdef }
  232. on *:load:{ dialog -dm Options Options }
  233. on *:start:{ set %account %ref.name | .timer 1 5 upd | .timer 1 10 connect }
  234. on *:input:@Whisper-*:{
  235.   echo 4 $active $timestamp $+(,$me,:01) $1-
  236.   whisper %whisper. [ $+ [ $remove($active,@Whisper-) ] ] $remove($active,@Whisper-) : $+ $oa_fnt($1-)
  237.   haltdef
  238. }
  239.  
  240. dialog accesslist {
  241.   title "Chatroom Accesslist"
  242.   size -1 -1 220 150
  243.   option dbu
  244.   list 1, 5 10 175 138, sort size hsbar vsbar
  245.   button "Add Access" 2, 182 10 35 15
  246.   button "Del Access" 3, 182 27 35 15
  247.   button "Refresh", 4, 182 44 35 15
  248. }
  249.  
  250. on *:dialog:accesslist:init:0:{ set %acc.chan $active | access $active }
  251. on *:dialog:accesslist:sclick:*:{
  252.   if ($did == 2) { /dialog -dm Add.access Add.access } | if ($did == 3) { /access %acc.chan delete $did(1).seltext | did -r $dname 1 | /access $active }
  253.   if ($did == 4) { /did -r $dname 1 | access $active }
  254. }
  255.  
  256. dialog Add.access {
  257.   title "Add Entry"
  258.   size -1 -1 150 75
  259.   option dbu
  260.   combo 1, 35 5 103 50, drop
  261.   edit "" 2, 35 18 103 11 autohs
  262.   edit "" 3, 35 31 30 10
  263.   edit "" 4, 35 43 103 11 autohs
  264.   text "Type:", 5, 19 6 15 7,right
  265.   text "Access Mask:", 6, 1 19 33 7,right
  266.   text "Entry time:", 7, -7 32 40 7,right
  267.   text "Reason:", 8, 12 45 21 7,right
  268.   text "Minutes", 9, 65 32 20 7,right
  269.   button "Add", 10, 40 58 45 10, center
  270.   button "Cancel", 11, 85 58 45 10, cancel
  271. }
  272.  
  273. on *:dialog:Add.access:init:0:{
  274.   didtok Add.access 1 44 Owner,Host,Voice,Grant,Deny
  275.   did -c Add.access 1 1
  276.   did -a Add.access 3 0
  277. }
  278.  
  279. on *:dialog:Add.access:sclick:10:{ if ($dialog(Add.access)) /access %acc.chan add $did(1).text $did(2).text $did(3).text $did(4).text | if ($dialog($dname)) did -r accesslist 1 | /access $active }
  280.  
  281. dialog Options {
  282.   title "Dialog options manager"
  283.   size -1 -1 170 120
  284.   option dbu
  285.   tab Accounts, 9, 0 -2 175 125
  286.   tab Favorites, 10
  287.   tab Switch's, 16
  288.   tab Chat room creation, 22
  289.   list 1, 0 13 170 70, sort size hsbar vsbar, tab 9
  290.   button "Add account" 2, 10 85 35 12, tab 9
  291.   button "Del account" 3, 48 85 35 12, tab 9
  292.   button "Upd account" 4, 85 85 35 12, tab 9
  293.   button "SW account" 5, 122 85 35 12, tab 9
  294.   check "Main svr" 6, 50 102 28 12, tab 9
  295.   check "Group svr" 7, 85 102 32 12, tab 9
  296.   link "Click here for API Data" 8, 55 113 100 15, tab 9
  297.   list 11, 0 13 115 107, sort size hsbar vsbar, tab 10
  298.   button "Add Current" 12, 125 15 40 12, tab 10
  299.   button "Add Chat room" 13, 125 35 40 12, tab 10
  300.   button "Delete Sel" 14, 125 55 40 12, tab 10
  301.   check  "Auto connect sel" 15, 120 75 55 12, tab 10
  302.   check "Away flood prot" 17, 5 15 47 12, tab 16
  303.   check "Deowner prot" 18, 5 30 45 12, tab 16
  304.   check "Deop prot" 19, 5 45 32 12, tab 16
  305.   check "Set owner key", 20, 100 15 47 12, tab 16
  306.   check "Set host key", 21, 100 30 47 12, tab 16
  307.   text "Name:", 23, 5 15 50 12, tab 22
  308.   text "Category:", 24, 5 45 50 12, tab 22
  309.   text "Language:", 25, 5 63 50 12, tab 22
  310.   text "Locale:", 26, 13 81 50 12, tab 22
  311.   text "Topic:", 27, 5 30 50 12, tab 22
  312.   edit "", 28, 20 15 148 10, tab 22
  313.   edit "", 29, 20 29 148 10, tab 22
  314.   combo 30, 31 44 90 10, drop, tab 22
  315.   combo 31, 31 62 90 10, drop, tab 22
  316.   combo 32, 31 80 90 10, drop, tab 22
  317.   button "Create", 33, 50 100 35 13, tab 22
  318.   button "Cancel", 34, 90 100 35 13, tab 22
  319. }
  320.  
  321. on *:dialog:Options:*:*:{
  322.   if ($devent == init) {
  323.     didtok $dname 30 44 UL - Unlisted,GE - City Chats,CP - Computing,EA - Entertainment,EV - Events,GN - General,HE - Health,II - Interests,LF - Lifestyles,MU - mp3,NW - News,PT - Chat Partners,PR - Peers,RL - Religion,RP - Role Play,RM - Romance,SP - Sports & Recreation
  324.     didtok $dname 31 44 English,French,German,Japanese,Swedish,Dutch,Korean,Chinese (Simplified),Portuguese,Finnish,Danish,Russian,Italian,Norwegian,Chinese (Traditional),Spanish,Czech,Greek,Hungarian,Polish,Slovene,Turkish,Slovak,Portuguese (Brazilian)
  325.     didtok $dname 32 44 Australia - EN-AU,Austria - DE-AT,Belgium (Dutch) - NL-BE,Belgium (French) - FR-BE,Brazil - PT-BR,Canada (English) - EN-CA,Canada (French) - FR-CA,Denmark - DA-DK,Finland - FI-FI,France - FR-FR,Germany - DE-DE,Hong Kong S.A.R. - ZH-HK,India - EN-IN,Italy - IT-IT,Japan - JA-JP,Korea - KO-KR,Latin America - ES-LA,Malaysia - ML-MY,Mexico - ES-MX,Netherlands - NL-NL,New Zealand - EN-NZ,Norway - NO-NO,Spain - ES-ES,Singapore - ZH-SG,South Africa - ZH-TW,Sweden - SV-SE,Switzerland (French) - FR-CH,Switzerland (German) - DE-CH,Taiwan - ZH-TW,United Kingdom - EN-GB,United States (English) - EN-US,United States (Spanish) - ES-LA
  326.     did -c $dname 30,31, 1 | did -c $dname 32 31
  327.     $iif(81 isin %server.ip,did -c $dname 6,did -c $dname 7) | account.read
  328.   }
  329.   if ($devent == sclick) {
  330.     if ($did == 1) { set %s.account $did($dname,1).seltext | set %acc.line $did($dname,1).sel }
  331.     if ($did == 2) { set %ref.name $$?"Step 1: Enter you Nickname for the account" | set %_oa.api_key $$?"Step 2: Enter your api key" | set %_oa.api_pass $$?"Step 3: Enter your api pass" | set %serv.type $$?"Step 4: Enter M for Main and G for Group" | var %account $$?"Please designate account (account1-10) $chr(124) Ex: account1" | writeini -n user.accounts.ini account %account %ref.name | writeini -n user.accounts.ini %ref.name api.key %_oa.api_key | writeini user.accounts.ini %ref.name api.pass %_oa.api_pass | did -a $dname 1 %ref.name | var %a $len($readini(user.accounts.ini,%ref.name,api.key)), %b $len($readini(user.accounts.ini,%ref.name,api.pass)) | if (%a != 36) || (%b != 32) { Echo -s 4 Error: API Data/Input error } | else echo -s 4 Status: API Data Set. Aquiring IRCx AUTH data.. | upd | serv.type | /nick %ref.name | connect }
  332.     if ($did == 3) { remini -n user.accounts.ini %s.account | remini -n user.accounts.ini account account $+ %acc.line | account.read }
  333.     if ($did == 4) { upd }
  334.     if ($did == 5) { unset %_oa.api_key | unset %_oa.api_pass | set %_oa.api_key $readini(user.accounts.ini,account,%s.account,api.key)) | set %_oa.api_pass $readini(user.accounts.ini,account,%s.account,api.pass)) | echo -s 4 Status: API Data Set. Aquiring IRCx AUTH data.. | upd | .timerconn 1 4 /quit | set -u10 %acc.sw $true | /nick %s.account }
  335.     if ($did == 6) { set %serv.type M | serv.type | did -c $dname 6 } | if ($did == 7) { set %serv.type G | serv.type | did -c $dname 7 }
  336.     if ($did == 8) { url -an http://chat.oasiz.net/chat_api_key }
  337.     if ($did == 10) { did -r $dname 11 | Fav.list }
  338.     if ($did == 11) { set %s.chan $did(11).seltext | set %chan.num $did(11).sel }
  339.     if ($did == 12) { /did -a $dname 11 $active | set %add $readini(Favorite.ini,%account,channels) | set %channel $remove($active,$chr(37),$chr(35)) | $iif($readini(Favorite.ini,%account,chan.count),writeini -n Favorite.ini %account chan.count $calc($readini(Favorite.ini,%account,chan.count) + 1),writeini -n Favorite.ini %account chan.count 1)) | $iif(%add,writeini -n Favorite.ini %account Channels $addtok(%add,%channel,32),writeini -n Favorite.ini %account channels %channel)) }
  340.     if ($did == 13) { var %chan $$?"Enter Chatroom name $chr(124) No Channel prefix" | set %add $readini(Favorite.ini,%account,channels) | /did -a $dname 11 $chr(37) $+ $chr(35) $+ %chan |  $iif($readini(Favorite.ini,%account,chan.count),writeini -n Favorite.ini %account chan.count $calc($readini(Favorite.ini,%account,chan.count) + 1),writeini -n Favorite.ini %account chan.count 1)) | $iif(%add,writeini -n Favorite.ini %account Channels $addtok(%add,%chan,32),writeini -n Favorite.ini %account channels %chan)) }
  341.     if ($did == 14) { /did -d $dname 11 %chan.num | writeini -n Favorite.ini %account channels $deltok(%channels,%chan.num,32))) | writeini -n Favorite.ini %account Join $deltok(%channels,%chan.num,32))) | writeini -n Favorite.ini %account chan.count $calc($readini(Favorite.ini,%account,chan.count) - 1) }
  342.     if ($did == 15) { set %add $readini(Favorite.ini,%account,Join) | $iif(%add,writeini -n Favorite.ini %account Join $addtok(%add,$remove(%s.chan,$chr(37),$chr(35)),32),writeini -n Favorite.ini %account Join $remove(%s.chan,$chr(37),$chr(35))) }
  343.     if ($did == 16) { $iif($group(#deowner.prot) == on,did -c $dname 18,$null)) | $iif($group(#deop.prot) == on,did -c $dname 19,$null)) | $iif($group(#away.fl.prot) == on,did -c $dname 17,$null)) }
  344.     if ($did == 17) { $iif($group(#away.fl.prot) == off,.enable #away.fl.prot,.disable #away.fl.prot)) }
  345.     if ($did == 18) { $iif($group(#deowner.prot) == off,.enable #deowner.prot,.disable #deowner.prot)) }
  346.     if ($did == 19) { $iif($group(#deop.prot) == off,.enable #deop.prot,.disable #deop.prot)) }
  347.     if ($did == 20) { /prop $active Ownerkey $$?"Enter Owner Key" }
  348.     if ($did == 21) { /prop $active Hostkey $$?"Enter Host Key" }
  349.     if ($did == 33) { set %c $chr(37) $+ $chr(35) $+ $did($dname,28).text | key | /create $gettok($did($dname,30).text,1,32)) $chr(37) $+ $chr(35) $+ $did($dname,28).text $replace($iif($did($dname,29).text,$did($dname,29).text,-),$chr(32),\b)) - $right($gettok($did($dname,32).seltext,3-5,32),5)) $did($dname,31).sel %key. 0 }
  350.   }
  351. }
  352.  
  353. #deowner.prot off
  354. #deowner.prot end
  355. #deop.prot on
  356. #deop.prot end
  357. #away.fl.prot off
  358. #away.fl.prot end
Advertisement
Add Comment
Please, Sign In to add comment