home *** CD-ROM | disk | FTP | other *** search
- /* comment */
-
- HOST = address()
-
- address command
-
- 'copy S:join.log RAM:'
-
- address value HOST
-
- options results
-
- botnick = 'SASS'
- channame = '#ChatBoxTest'
- friends = 'S:ircrc.amiga'
- logfile = 'RAM:join.log'
-
- a.CMD = 'NONE'
- command = 'NONE'
- rtc = 'none'
- quiet = 0
- toldme = 'I am allowed to talk.'
- opcnt = 0
- bancnt = 0
- kickcnt = 0
- kbcnt = 0
- faqcnt = 0
- tryme = 234
- joined = 0
-
- CMD '/nick '||botnick
- CMD '/load '||friends
-
- do while a.CMD ~= '/endrexx'
-
- WAIT STEM a.
- command = upper(a.CMD)
- if command == 'PRIVMSG' THEN
- rtc = do_privmsg(channame)
- else if command == 'JOIN' THEN
- rtc = do_join()
- else if command == 'INVITE' THEN
- do
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH == 1 THEN
- do
- if joined == 1 THEN
- CMD '/leave'
- CMD '/join '||a.LINE
- end
- else
- CMD '/msg '||a.NICK||' You cannot invite me to another channel.'
- end
- else if command == 'KICK' THEN
- do
- if a.NICK == botnick THEN
- joined = 0
- else nop
- end
- else if command == 'PART' THEN
- do
- if a.NICK == botnick THEN
- joined = 0
- else nop
- end
- else if command == 'NICK' THEN
- do
- if a.NICK == botnick THEN
- botnick = a.LINE
- else
- do
- if open('log', logfile, 'A') THEN
- writeln('log', a.NICK||' '||a.ADDRESS)
- err = close('log')
- end
- end
- if rtc == 'quit' then
- do
- CMD '/msg '||channame||' I am quitting now, '||a.NICK
- CMD '/leave '||channame
- CMD '/free fr'
- CMD '/endrexx'
- exit 0
- end
- else if rtc == 'leave' then
- do
- CMD '/msg '||channame||' I am leaving now, '||a.NICK
- CMD '/leave '||channame
- end
- else if rtc ~= 'none' THEN
- CMD '/msg '||rtc
- else nop
- end
-
- exit 0
-
- do_privmsg: procedure expose a. quiet toldme opcnt bancnt kickcnt faqcnt tryme botnick friends logfile
-
- cnt = a.TOKENS.COUNT
- ppl = 'people'
- comment = 'Yer outta here!'
- comment2 = ''
-
- i = wordindex(a.LINE, 4)
- if i ~= 0 THEN
- comment = substr(a.LINE, i);
-
- i = wordindex(a.LINE, 3)
- if i ~= 0 THEN
- comment2 = substr(a.LINE, i);
-
- uline = a.LINE
- line = upper(a.LINE)
- chname = arg(1)
-
- if upper(a.CHANNEL) == upper(a.NICK) THEN return 'none'
-
- recip = a.CHANNEL
- if left(recip, 1) ~= '#' THEN
- recip = a.NICK
-
- if (word(line, 1) ~= botnick) & (recip == a.CHANNEL) THEN
- do
- if quiet == 1 then return 'none'
- if pos('FUCK', line) ~= 0 THEN
- return recip||' '||a.NICK||', you potty mouth.'
- else if pos('ANYONE KNOW ', line) ~= 0 THEN
- return recip||' '||a.NICK||', I know nothing.'
- else if left(line, 4) == 'PING' THEN
- return recip||' '||a.NICK||', PONG!!!'
- return 'none'
- end
-
- faqline = 'NULL'
-
- if recip == a.CHANNEL THEN
- do
- sasc = word(line, 2)
- target = word(line, 3)
- target2 = word(uline, 3)
- end
- else
- do
- sasc = word(line, 1)
- target = word(line, 2)
- target2 = word(uline, 2);
- end
-
- if sasc == 'FAQ' THEN
- do
- if target == '' then return a.NICK||' : Format for FAQ: FAQ <topic>'
- else if target == 'LIST' THEN
- do
- address /* address command */
- 'cbdir >RAM:LIST.txt S:FAQS/' /* save FAQ directory to RAM:LIST */
-
- address /* address HOST again */
- if open('faqfile', 'RAM:LIST.txt') == 0 THEN
- faqline = 'FAQ LIST is unavailable, try again later..., '||a.NICK
- else
- do while eof('faqfile') ~= 1
- faqline = readln('faqfile')
- if length(faqline) > 1 THEN
- CMD '/msg '||recip||' '||faqline
- end
- return 'none'
- end
- else nop
- if open('faqfile', 'S:FAQS/'||target) == 0 THEN
- faqline = a.NICK||' : There is no FAQ for '||target||', or file is unavailable...'
- else
- do
- faq = readln('faqfile')
- faqline = readln('faqfile')
- end
- err = close('faqfile')
- faqcnt = faqcnt + 1
- return recip||' -=>'||faq||'<=- : '||faqline
- end
- else if sasc == 'ADDFAQ' THEN
- do
- if target == '' | comment == 'Yer outta here!' THEN return a.NICK||' Missing parameters for ADDFAQ.'
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH ~= 1 THEN
- return a.NICK||' Your status is not high enough to add FAQs'
- if exists('S:faqs/'||target2) THEN
- return recip||' FAQ on >'||target2||'< is already on file.'
-
- if open('faqfile', 'S:faqs/'||target2, 'W') THEN
- do
- writeln('faqfile', target2)
- writeln('faqfile', comment2)
- end
- err = close('faqfile');
- return recip||' Faq on *>'||target2||'<* has been added'
- end
- else if sasc == 'REMFAQ' THEN
- do
- if target == '' THEN return a.NICK||' Missing parameters for REMFAQ.'
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH ~= 1 THEN
- return a.NICK||' Your status is not high enough to remove FAQs'
- if exists('S:faqs/'||target2) THEN
- do
- address
- 'delete >NIL: <NIL: S:faqs/'||target2
- address
- return recip||' FAQ on >'||target2||'< has been removed.'
- end
-
- return recip||' There is no FAQ on *>'||target2||'<*'
- end
- else if sasc == 'BAN' THEN
- do
- if target == '' then return a.NICK||' Missing parameter for BAN.'
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH ~= 1 THEN
- return a.NICK||' You do not have that access...'
- else
- do
- if pos('kb', info.STATUS) == 0 THEN
- return a.NICK||' You do not have that access...'
- else NOP
- bancnt = bancnt + 1
- kickcnt = kickcnt + 1
- if upper(target) == botnick THEN
- return chname||' Nice try, '||a.NICK
- NICKONCH NICK target CHANNEL chname VAR ison
- found=0
- if ison THEN
- do
- CMD '/deop '||chname||' '||target
- CMD '/ban '||chname||' '||target
- CMD '/kick '||chname||' '||target||' '||comment
- end
- else
- do
- if open('log', logfile, 'R') THEN
- do while eof('log') == 0 & found == 0
- joiner = readln('log')
- if upper(word(joiner, 1)) == target THEN
- found = 1
- end
- if found THEN
- do
- baddress = word(joiner, 2)
- parse var baddress user'@'nix'.'d1
- CMD '/ban '||chname||' *!*'user'@*.'||d1
- end
- err=close('log')
- end
- end
- end
- else if sasc == 'KICK' THEN
- do
- if target == '' then return a.NICK||' Missing parameter for KICK.'
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH ~= 1 THEN
- return a.NICK||' You do not have that access...'
- else
- do
- if pos('k', info.STATUS) == 0 THEN
- return a.NICK||' You do not have that access...'
- else NOP
- kickcnt = kickcnt + 1
- if upper(target) ~= botnick THEN
- CMD '/kick '||chname||' '||target||' '||comment
- else
- return chname||' Nice try, '||a.NICK
- end
- end
- else if sasc == 'OP' THEN
- do
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH ~= 1 THEN
- return a.NICK||' You do not have that access...'
- else
- do
- if pos('c', info.STATUS) == 0 THEN
- return a.NICK||' You do not have that access...'
- else NOP
- if target == '' THEN
- CMD '/op '||chname||' '||a.NICK
- else if target ~= 'ME' THEN
- CMD '/op '||chname||' '||target
- else if target == 'ME' THEN
- CMD '/msg '||a.NICK||' Use: ''/msg SASS op'', or in the channel: ''sass op'', the ''ME'' is no longer required.'
- opcnt = opcnt + 1
- end
- end
- else if sasc == 'QUIET' THEN
- do
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH == 0 THEN return chname||' You cannot tell me what to do, '||a.NICK||'!!!'
- quiet = 1
- CMD '/msg '||chname||' I''ll be quiet, '||a.NICK
- toldme = 'I was told to be quiet by '||a.NICK
- end
- else if sasc == 'TALK' THEN
- do
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH == 0 THEN return chname||' You cannot tell me what to do, '||a.NICK||'!!!'
- quiet = 0
- CMD '/msg '||chname||' I''m ready to talk, '||a.NICK
- toldme = 'I was allowed to talk by '||a.NICK
- end
- else if sasc == 'STATUS' THEN
- do
- CMD '/msg '||recip||' '||toldme
- if opcnt == 1 then ppl = 'person.'
- else ppl = 'people.'
- CMD '/msg '||recip||' I have opped '||opcnt||' '||ppl
- if kickcnt == 1 then ppl = 'person.'
- else ppl = 'people.'
- CMD '/msg '||recip||' I have kicked '||kickcnt||' '||ppl
- if bancnt == 1 then ppl = 'person.'
- else ppl = 'people.'
- CMD '/msg '||recip||' I have banned '||bancnt||' '||ppl
- ppl = 'times.'
- if faqcnt == 1 then ppl = 'time.'
- else ppl = 'times.'
- CMD '/msg '||recip||' I''ve been asked for FAQs '||faqcnt||' '||ppl
- end
- else if sasc == 'SVIEW' THEN
- do
- personal = 0
- if target == '' THEN
- do
- target = a.NICK
- personal = 1
- end
- notfound = 1
- target = upper(target)
- if open('frndfile', friends) THEN
- do while eof('frndfile') ~= 1
- faqline = readln('frndfile')
- faq = word(faqline, 4)
- faq2 = upper(faq)
- if faq2 == target THEN
- do
- notfound = 0
- if personal THEN
- CMD '/msg '||a.NICK||' Status for '||faq||' ('||word(faqline, 3)||') is '||word(faqline, 2)
- else
- CMD '/msg '||a.NICK||' Status for '||faq||' ('||word(faqline, 3)||') is '||word(faqline, 2)
- end
- end
- err = close('frndfile')
- if notfound THEN
- CMD '/msg '||a.NICK||' Status for '||a.NICK||' ('||a.ADDRESS||') is <unset>'
- end
- else if sasc == 'TRYME' THEN
- do
- tryme = random(1, 10)
- if tryme == 5 THEN
- do
- CMD '/me takes aim at '||a.NICK||' -=<*POP*>=-'
- CMD '/kick '||a.NICK||' RIGHT in the head...'
- end
- else
- do
- CMD '/me takes aim at '||a.NICK||' <<fizzle>>'
- CMD '/msg '||chname||' '||a.NICK||', you lucky dog!'
- end
- end
- else if sasc == 'HUG' THEN
- do
- if target == '' THEN return a.NICK||' Missing parameter for HUG.'
- if recip == a.CHANNEL THEN
- target = word(uline, 3)
- else
- target = word(uline, 2)
- CMD '/me *H*U*G*S* '||target||' for '||a.NICK||'.'
- end
- else if sasc == 'ADD' THEN
- do
- if target == '' THEN return a.NICK||' Missing parameter for ADD.'
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH == 0 THEN return a.NICK||' You do not have that access.'
- if pos('a', info.STATUS) == 0 THEN return a.NICK||' You do not have access to the ADD command.'
- if recip == a.CHANNEL THEN i=3
- else i=2
- target = word(uline, i)
- addr = word(uline, i+1)
- modes = word(uline, i+2)
- if addr == '' THEN return a.NICK||' Missing parameter for ADD.'
- CMD '/chop '||target||' '||addr
- CMD '/msg '||target||' Your level has been increased to access: +c'||modes
- if modes == '' THEN return 'none'
- CMD '/chg '||target||' +'||modes
- if open('ffile', friends, 'A') THEN
- writeln('ffile', '/add +c'||modes||' *!*'||addr||' '||target)
- else nop
- err = close('ffile')
- end
- else if sasc == 'INVITE' THEN
- do
- MATCH NICK a.NICK ADDRESS a.ADDRESS STEM info.
- if info.ISMATCH == 1 THEN
- CMD '/invite '||a.NICK||' '||chname
- else if quiet == 0 THEN
- do
- CMD '/msg '||chname||' '||a.NICK||' would like to be invited.'
- CMD '/msg '||a.NICK||' I can''t invite you, I have asked the others...'
- end
- else
- return a.NICK||' I was told to be quiet, so I cannot invite you, nor tell others to.'
- end
- else if sasc == 'QUIT' THEN return 'quit'
- else if sasc == 'LEAVE' THEN return 'leave'
- else if sasc == 'UPDATE' THEN
- do
- if left(recip, 1) == '#' THEN return 'none'
- if word(uline, 2) ~= 'betacbaccess' THEN return 'none'
- towho = upper(a.NICK)
- if pos('KLIF', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-30'
- else if pos('CAPPY', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-41'
- else if pos('FASTLANE', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-30'
- else if pos('ROBR', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-30'
- else if pos('SKYGUY', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-41'
- else if pos('SAIFUL', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox000-40'
- else if pos('JTW', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox000-41'
- else if pos('DARIUS', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-41'
- else if pos('CAMELOT', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-41'
- else if pos('FONEMAN', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-41'
- else if pos('AK', towho) THEN
- cbvers = 'Work:S_ChatBox/updates/ChatBox030-41'
- else if pos('SASCMAN', towho) THEN
- do
- CMD '/msg '||a.NICK||' it will work...'
- return 'none'
- end
- else return 'none'
- CMD '/dcc send '||a.NICK||' '||cbvers
- end
- else if sasc == 'CBVERS' THEN
- return a.NICK||' Current version is 1.125 Beta'
- else if sasc == 'KISS' THEN
- return chname||' '||a.NICK||', you wish!'
- else if sasc == 'DANCE' THEN
- CMD '/me swings '||a.NICK||' around, launching him out the window!'
- else if sasc == 'SWIM' THEN
- CMD '/me can''t swim yet... I''m young, and only written in ARexx...'
- else if sasc == 'BITEME' THEN
- CMD '/me BITES '||a.NICK
- else if sasc == 'BITE' THEN
- CMD '/me BITES '||a.NICK
- else if sasc == 'FUCK' THEN
- CMD '/msg '||chname||' '||a.NICK||', into machinery, eh? ;)'
- else if sasc == 'SPANK' THEN
- CMD '/me takes '||a.NICK||' over his knee, and spanks the hell out of him.'
- else if sasc == 'BLOW' THEN
- return chname||' Into ''auto'' erotica, eh, '||a.NICK||'?'
- else if sasc == 'SMILE' THEN
- CMD '/me smiles at '||a.NICK
- else if sasc == 'SING' THEN
- CMD '/me sings ''I heard it through the ChatBox'' for '||a.NICK||' ;)'
- else if sasc == 'BURP' THEN
- do
- CMD '/me *BURPS* a wild one...'
- return chname||' Excuse me! =-\'
- end
- else if sasc == 'FART' THEN
- CMD '/me *SNIFFS*, ew, burning plastic...'
- else nop
-
- return 'none'
-
- do_join: procedure expose joined a. botnick channame logfile
-
- if a.NICK == botnick THEN
- do
- joined = 1
- channame = a.LINE
- CMD '/friends who'
- end
- else
- do
- if open('log', logfile, 'A') THEN
- writeln('log', a.NICK||' '||a.ADDRESS)
- err = close('log')
- end
-
- return 'none'
-