Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------------------------------------
- Thanks Rob for the peice's of socket coding I used to make this Possible.
- And Also the updater coding. I may add to this in the future.
- -----------------------------------------------------------------------
- :::::::::::Main Socket::::::::::
- on *:sockopen:oa.sock.*: {
- dosock $sockname IRCVERS IRC9 OASIZ-WEBC!2.05.15.069 $crlf
- dosock $sockname AUTH $iif(%DOPASSPORT,GateKeeperPassport,GateKeeper) I :GKSSP000000X1A
- dosock $sockname user web * * : $+ webc[2.05.15.065.]
- }
- on *:sockread:oa.sock.*: {
- var %o | sockread %o | tokenize 32 %o
- $sock_trace(<- $1-)
- if ($1 == PING && $2) {
- dosock $sockname PONG $2-
- }
- if ($1 $3 === AUTH S) {
- if ($4 === :OK) {
- if (%DOPASSPORT) {
- dosock $sockname AUTH GateKeeperPassport S : $+ %_oa.authcode
- }
- else {
- dosock $sockname NICK Guest_ $+ $rand(000,999)
- }
- }
- else {
- set %_oa.challengeType 0 | set %_oa.challengeCode 0
- $oaGo(2, $remove($4,:GKSSP000000))
- .timer. $+ $sockname 0 1 challenge_code_check $sockname
- }
- }
- elseif ($2 == JOIN) {
- 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. ))
- 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)
- }
- elseif ($2 == 353) {
- 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 }
- }
- elseif ($2 == Privmsg) { Var %nick = $right($gettok($1,1,33),-1)
- if ($4 == :ACTION) { echo 6 $3 * $right($gettok($1,1,33),-1) $5- }
- 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 } }
- elseif (%nick isowner $3) { echo $3 8• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
- elseif (%nick isop $3) { echo $3 05• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
- elseif (%nick == $mnick) { echo 12 $3 05• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
- elseif (%nick isvoice $3) { echo $3 3• %nick $+ : 12 $oa_fnt($right($4-,-1)) }
- elseif (%nick isreg $3) { echo $3 • $replace(%nick,>,Guest_) $+ : 12 $oa_fnt($right($4-,-1)) }
- else { echo $3 10The chat's onjoin is: 4 $right($4-,-1) }
- }
- 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 }
- 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) }
- elseif ($2 == 332) { echo $4 10 $+ The chat's topic is: 4 $right($5-,-1) }
- elseif ($2 == 464) { $iif(%q.pass,remini user.accounts.ini $active q.pass,remini user.accounts.ini $active h.pass )) }
- 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 }
- 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 }
- elseif ($2 == 804) { did -a accesslist 1 $remove($gettok($1-,5-20,32),:)) }
- elseif ($2 == 812) { /echo @channelist 4 $+ $4 $chr(32) 12 $5 $chr(32) $6 $chr(32) $remove($7-40,$chr(58)) | halt }
- elseif ($2 == 818) { if ($5 == PUID) url -an http://www.oasiz.net/forum/?showuser= $+ $right($6,-1) }
- 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 }
- if ($2 == MODE) && ($3 == $mnick) { goto done }
- 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 }
- 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) }
- 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 }
- :done
- }
- 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 } }
- elseif ($2 == whisper) {
- var %nick = $right($gettok($1,1,33),-1) | $iif(%whisper. [ $+ [ %nick ] ],$null,userip %nick)) | set -u5 %w.chan $3 | set -u5 %w.nick %nick
- if (\x01ONSCR isin $1-) { echo $3 4 $chr(40) $+ Onscreen Whisper From %nick $+ $chr(41) $chr(58) $oa_fnt($6-) | halt }
- else { window -eokn @Whisper- [ $+ [ %nick ] ] -1 -1 350 200 | echo 12 -t @Whisper- [ $+ [ %nick ] ] $+(,%nick,:)) $oa_fnt($5-) | set %whisper. [ $+ [ %nick ] ] $3 }
- }
- elseif ($2 == KICK) { var %nick = $right($gettok($1,1,33),-1) | dosock oa.local %o
- if ($4 == $mnick) {
- 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 }
- echo 4 $3 Host $right($1,-1) kicked $4 $address($4,1) $right($5-,-1) | haltdef
- }
- else {
- $iif($sock(oa.local).status == active,sockwrite -n oa.local %o,/sockclose oa.local /connect))
- }
- }
- :::::::::::Local Socket::::::::::
- on *:sockclose:oa.sock.*:{
- sockclose oa.local
- if ($status != disconnected) { disconnect }
- }
- on *:sockread:oasiz*: {
- if ($sockerr > 0) return
- var %z | sockread %z
- while ($sockbr > 0) {
- tokenize 32 %z
- if ($regex($1-,/challenge": "(.*)"/)) { set %_oa.challengeCode $regml(1) | $iif(%_oa.challengeType == 1,.RAW -q AUTH GateKeeperPassport S :GKSSP000000 $+ $regml(1),) | return }
- if ($regex($1-,/authcode": "(.*)"/)) { set %_oa.authcode $regml(1) | echo -s 4 Updating Complete | return }
- if ($regex($1-,/"message": "(.*)"/)) { echo -s 4 Error: $regml(1) | echo -s 4 Updating Failed | return }
- return
- }
- sockread %z
- }
- on *:sockopen:oasiz*: {
- sockwrite -n $sockname GET /api?api_key= $+ %_oa.api_key $+ &access_token= $+ $access_token() $+ ×tamp= $+ %_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)
- }
- on *:socklisten:listen:{
- sockaccept oa.local | sockclose $sockname
- }
- on *:sockread:oa.local:{
- var %x | sockread %x | tokenize 32 %x
- $sock_trace(<- $1-)
- sockwrite -n oa.sock.* %x
- }
- :::::::::::Alias's::::::::::
- alias oaGo {
- if ( $1 === 1 ) { set %_oa.api_call ircx_authcode }
- else { set %_oa.api_query $2 | set %_oa.api_call ircx_challenge }
- sockopen -e oasiz $+ $rand(000,999) www.oasiz.net 443
- }
- on ^*:logon:*: { haltdef }
- alias challenge_code_check {
- if (%_oa.challengeCode != 0) {
- .timer. $+ $1 off
- dosock $1 AUTH $iif(%DOPASSPORT,GateKeeperPassport,GateKeeper) S :GKSSP000000 $+ $+ %_oa.challengeCode
- }
- }
- alias hmacsha1 {
- var %key $1, %data $2
- bset -c &key 1 $regsubex(%key,/(.)/g, $asc(\1) $chr(32))
- bset -c &data 1 $regsubex(%data,/(.)/g, $asc(\1) $chr(32))
- if ($bvar(&key,0) > 64) bset -c &key 1 $hex2chr($sha1(&key,1))
- bset -c &ipad 1 $xorall($str($+(54,$chr(32)),64),$bvar(&key,1-))
- bset -c &opad 1 $xorall($str($+(92,$chr(32)),64),$bvar(&key,1-))
- bcopy &ipad $calc($bvar(&ipad,0) + 1) &data 1 -1
- bset -c &ipad 1 $hex2chr($sha1(&ipad,1))
- bcopy &opad $calc($bvar(&opad,0) + 1) &ipad 1 -1
- bset -c &return 1 $hex2chr($sha1(&opad,1))
- noop $encode(&return, mb)
- $iif($isid,return,$iif(#,say,echo -a)) $bvar(&return, 1-).text
- }
- alias -l hex2chr { return $regsubex($1-,/(.{2})/g, $base(\t,16,10) $chr(32)) }
- alias -l xorall {
- var %p $1, %k $2, %end $iif($regex($1,/([\d]{1,})/g) > $regex($2,/([\d]{1,})/g),$v1,$v2)
- return $regsubex($str(.,%end),/(.)/g,$+($xor($iif($gettok(%p,\n,32),$v1,0),$iif($gettok(%k,\n,32),$v1,0)),$chr(32)))
- }
- alias access_token {
- set %_oa.api_time $ctime
- var %json $chr(123) $+ "timestamp": $+ %_oa.api_time $+ $chr(125)
- return $md5($hmacsha1(%_oa.api_pass,%json))
- }
- alias oa_fnt { return $regsubex($1-,/S~:.*$/gi,$null) }
- alias connect {
- set %DOPASSPORT $true
- .server 127.0.0.1 4000 | socklisten listen 4000
- sockopen oa.sock. $+ $rand(11111,99999) %server.ip 6667
- .timerpingtimeoutck 0 30 /socket_watch
- }
- alias sock_trace {
- if (!$window(@trace)) { /window -e @trace }
- echo @trace $timestamp $1-
- }
- alias sock_close {
- sockclose oa.sock.* | sockclose oa.local
- }
- alias dosock {
- $sock_trace(-> $2-)
- sockwrite -n $1-
- }
- alias socket_watch {
- if ($sock(oa.sock.*).status == active) { halt }
- else { sock_close | connect }
- }
- alias upd { echo -s 4 Updating passport: %s.account | $oaGO(1) }
- 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- }
- 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. }
- alias knock.fl { set -u15 %knock.watch $calc(%knock.watch + 1) | $iif(%knock.watch >= 5,/mode %k.chan -u,$null)) }
- 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 }
- 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)) } }
- alias serv.type { $iif(M isin %serv.type,set %server.ip 96.47.34.246,set %server.ip 96.47.34.241)) }
- alias Fav.list {
- 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)
- while (%b < %a) {
- inc %b
- if ($dialog(Options)) { /did -a Options 11 $chr(37) $+ $chr(35) $+ $gettok(%channels,%b,32))) }
- $iif($dialog(Options),$null,$iif(%j.chans,/join $chr(37) $+ $chr(35) $+ $gettok(%j.chans,%b,32)))
- }
- }
- menu channel {
- .Channel keys
- .owner up $chr(40) $+ $readini(user.accounts.ini,#,q.pass) $+ $chr(41):{ set %q.pass 1 | .pass # $readini(user.accounts.ini,#,q.pass) }
- .host up $chr(40) $+ $readini(user.accounts.ini,#,h.pass) $+ $chr(41):{ unset %q.pass | .pass # $readini(user.accounts.ini,#,h.pass) }
- -
- $iif(($me isop #),$style(0),$style(2)) Accesslist:/dialog -dm accesslist accesslist
- }
- menu nicklist {
- .View Profile:{ /prop $$1 PUID }
- }
- menu menubar,status {
- .Options dialog:{ dialog -dm Options Options }
- .Oasiz Channelist:{ if (!$window(@Channelist)) { /window -e @channelist | listx } }
- }
- :::::::::::Event's::::::::::
- on *:disconnect:{ if (%acc.sw == $true) { .timerconn2 1 5 /connect } }
- on ^*:rawmode:*:{ haltdef }
- on ^*:join:#:{ haltdef }
- on ^*:part:#:{ haltdef }
- on ^*:kick:#:{ haltdef }
- on ^*:TOPIC:#:{ haltdef }
- on *:load:{ dialog -dm Options Options }
- on *:start:{ set %account %ref.name | .timer 1 5 upd | .timer 1 10 connect }
- on *:input:@Whisper-*:{
- echo 4 $active $timestamp $+(,$me,:01) $1-
- whisper %whisper. [ $+ [ $remove($active,@Whisper-) ] ] $remove($active,@Whisper-) : $+ $oa_fnt($1-)
- haltdef
- }
- dialog accesslist {
- title "Chatroom Accesslist"
- size -1 -1 220 150
- option dbu
- list 1, 5 10 175 138, sort size hsbar vsbar
- button "Add Access" 2, 182 10 35 15
- button "Del Access" 3, 182 27 35 15
- button "Refresh", 4, 182 44 35 15
- }
- on *:dialog:accesslist:init:0:{ set %acc.chan $active | access $active }
- on *:dialog:accesslist:sclick:*:{
- 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 }
- if ($did == 4) { /did -r $dname 1 | access $active }
- }
- dialog Add.access {
- title "Add Entry"
- size -1 -1 150 75
- option dbu
- combo 1, 35 5 103 50, drop
- edit "" 2, 35 18 103 11 autohs
- edit "" 3, 35 31 30 10
- edit "" 4, 35 43 103 11 autohs
- text "Type:", 5, 19 6 15 7,right
- text "Access Mask:", 6, 1 19 33 7,right
- text "Entry time:", 7, -7 32 40 7,right
- text "Reason:", 8, 12 45 21 7,right
- text "Minutes", 9, 65 32 20 7,right
- button "Add", 10, 40 58 45 10, center
- button "Cancel", 11, 85 58 45 10, cancel
- }
- on *:dialog:Add.access:init:0:{
- didtok Add.access 1 44 Owner,Host,Voice,Grant,Deny
- did -c Add.access 1 1
- did -a Add.access 3 0
- }
- 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 }
- dialog Options {
- title "Dialog options manager"
- size -1 -1 170 120
- option dbu
- tab Accounts, 9, 0 -2 175 125
- tab Favorites, 10
- tab Switch's, 16
- tab Chat room creation, 22
- list 1, 0 13 170 70, sort size hsbar vsbar, tab 9
- button "Add account" 2, 10 85 35 12, tab 9
- button "Del account" 3, 48 85 35 12, tab 9
- button "Upd account" 4, 85 85 35 12, tab 9
- button "SW account" 5, 122 85 35 12, tab 9
- check "Main svr" 6, 50 102 28 12, tab 9
- check "Group svr" 7, 85 102 32 12, tab 9
- link "Click here for API Data" 8, 55 113 100 15, tab 9
- list 11, 0 13 115 107, sort size hsbar vsbar, tab 10
- button "Add Current" 12, 125 15 40 12, tab 10
- button "Add Chat room" 13, 125 35 40 12, tab 10
- button "Delete Sel" 14, 125 55 40 12, tab 10
- check "Auto connect sel" 15, 120 75 55 12, tab 10
- check "Away flood prot" 17, 5 15 47 12, tab 16
- check "Deowner prot" 18, 5 30 45 12, tab 16
- check "Deop prot" 19, 5 45 32 12, tab 16
- check "Set owner key", 20, 100 15 47 12, tab 16
- check "Set host key", 21, 100 30 47 12, tab 16
- text "Name:", 23, 5 15 50 12, tab 22
- text "Category:", 24, 5 45 50 12, tab 22
- text "Language:", 25, 5 63 50 12, tab 22
- text "Locale:", 26, 13 81 50 12, tab 22
- text "Topic:", 27, 5 30 50 12, tab 22
- edit "", 28, 20 15 148 10, tab 22
- edit "", 29, 20 29 148 10, tab 22
- combo 30, 31 44 90 10, drop, tab 22
- combo 31, 31 62 90 10, drop, tab 22
- combo 32, 31 80 90 10, drop, tab 22
- button "Create", 33, 50 100 35 13, tab 22
- button "Cancel", 34, 90 100 35 13, tab 22
- }
- on *:dialog:Options:*:*:{
- if ($devent == init) {
- 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
- 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)
- 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
- did -c $dname 30,31, 1 | did -c $dname 32 31
- $iif(81 isin %server.ip,did -c $dname 6,did -c $dname 7) | account.read
- }
- if ($devent == sclick) {
- if ($did == 1) { set %s.account $did($dname,1).seltext | set %acc.line $did($dname,1).sel }
- 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 }
- if ($did == 3) { remini -n user.accounts.ini %s.account | remini -n user.accounts.ini account account $+ %acc.line | account.read }
- if ($did == 4) { upd }
- 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 }
- 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 }
- if ($did == 8) { url -an http://chat.oasiz.net/chat_api_key }
- if ($did == 10) { did -r $dname 11 | Fav.list }
- if ($did == 11) { set %s.chan $did(11).seltext | set %chan.num $did(11).sel }
- 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)) }
- 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)) }
- 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) }
- 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))) }
- 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)) }
- if ($did == 17) { $iif($group(#away.fl.prot) == off,.enable #away.fl.prot,.disable #away.fl.prot)) }
- if ($did == 18) { $iif($group(#deowner.prot) == off,.enable #deowner.prot,.disable #deowner.prot)) }
- if ($did == 19) { $iif($group(#deop.prot) == off,.enable #deop.prot,.disable #deop.prot)) }
- if ($did == 20) { /prop $active Ownerkey $$?"Enter Owner Key" }
- if ($did == 21) { /prop $active Hostkey $$?"Enter Host Key" }
- 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 }
- }
- }
- #deowner.prot off
- #deowner.prot end
- #deop.prot on
- #deop.prot end
- #away.fl.prot off
- #away.fl.prot end
Advertisement
Add Comment
Please, Sign In to add comment