Login/Logout v1.6
Posted by cr4z3d
Friday, June 25, 2004
Description: Updated
Whats new:
Debugged from v1.5
Added areacode/weather information
Added dialog to make yourself/other users high access
Fixed the colorscheme no more different colors
Whats coming
PM me on IRC with anything else to addon, I thought of all of this so far :(
----
This script has been fully tested before I posted. Yet, there still might be bugs, because this is a fairly new script, even though were on v1.6 already.
----
on *:load: {
set $+(%,$address,access) 500
set $+(%,$address,color) [^K]0,1
}
menu channel {
None desided name
.Access/register: { dialog -m NST NST }
-
}
dialog NST {
title "None desided name"
size -1 -1 300 120
option dbu
menu "&file", 21
item "&quit", 22, cancel
tab "Pe&on", 5, 5 5 290 110
tab "Re&gister", 6, 5 5 290 110
tab "O&p", 30, 5 5 100 70
tab "Ma&ster", 71, 5 5 100 70
tab "Co-Owner", 72, 5 5 100 70
tab "Owner", 75, 5 5 100 70
button "Add",76,93 70 30 10, tab 75
edit "Address", 77, 8 40 200 10, tab 75
button "Add",73,93 70 30 10, tab 72
edit "Address", 74, 8 40 200 10, tab 72
button "Add",31,93 70 30 10, tab 5
edit "Address", 8, 8 40 200 10, tab 5
button "Add",66,93 70 30 10, tab 30
edit "Address", 67, 8 40 200 10, tab 30
button "Add",600,93 70 30 10, tab 71
button "Register",68,93 70 30 10, tab 6
edit "Address", 69, 8 40 200 10, tab 71
edit "Handle", 9, 8 40 80 10, tab 6
text "(eg: asdf)", 26, 100 41 85 10, tab 6
edit "Address", 10, 8 50 200 10, tab 6
text "(eg: ~asdf@ool-4350b88b.dyn.optonline.net)", 27, 100 51 120 10, tab 6
button "Cancel",79,93 80 30 10, cancel
}
On *:DIALOG:NST:sclick:31:{
set %peon.handle.unknown $did(NST,8).text
echo Added %peon.handle.unknown to peons list.
asdffffff
}
alias asdffffff {
set % [ $+ [ %peon.handle.unknown ] $+ access ] 100
}
On *:DIALOG:NST:sclick:66:{
set %op.handle.unknown $did(NST,67).text
echo Added %op.handle.unknown to ops list.
asdfffffff
}
alias asdfffffff {
set % [ $+ [ %op.handle.unknown ] $+ access ] 200
}
On *:DIALOG:NST:sclick:600:{
set %master.handle.unknown $did(NST,69).text
echo Added %master.handle.unknown to masters list.
asdffffffff
}
alias asdffffffff {
set % [ $+ [ %master.handle.unknown ] $+ access ] 300
}
On *:DIALOG:NST:sclick:73:{
set %coown.handle.unknown $did(NST,74).text
echo Added %coown.handle.unknown to Co-owners list.
asdffffffffff
}
alias asdffffffffff {
set % [ $+ [ %coown.handle.unknown ] $+ access ] 400
}
On *:DIALOG:NST:sclick:76:{
set %own.handle.unknown $did(NST,77).text
echo Added %own.handle.unknown to owners list.
asdfffffffffff
}
alias asdfffffffffff {
set % [ $+ [ %own.handle.unknown ] $+ access ] 500
}
On *:DIALOG:NST:sclick:68:{
set %usrrrrname $did(NST,9).text
set %addresssss $did(NST,10).text
registerrrr
}
alias registerrrr {
set $+(%,%addresssss,color) [^K]0,1
set %last2reg %usrrrrname
write registered.txt %usrrrrname
write something3.txt %addresssss / %usrrrrname
set %usrname %usrrrrname
set %pww $rand(A,Z) $+ $rand(a,z) $+ $rand(1,10) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(1,10)
echo Username: %usrrrrname Password: %pww
echo Please /msg $me ~login %usrrrrname %pww
writeini registered.ini %usrrrrname %pww 1
write something.txt %addresssss %usrrrrname
write something2.txt %addresssss
set $+(%,%addresssss,access) 100
echo Secret information: $read(something.txt,$lines(something.txt))
}
on *:text:~register *:?: {
if ($read(registered.txt,w, $+ $2)) {
msg $nick Pick a new name.
}
elseif ($read(something3.txt,w, $+ $address)) {
msg $nick you already registered.
}
else {
set $+(%,$address,color) [^K]1,0
set %last2reg $2
write registered.txt $2
write something3.txt $address / $2
set %usrname $2
set %pww $rand(A,Z) $+ $rand(a,z) $+ $rand(1,10) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(1,10)
msg $nick Username: $2 Password: %pww
msg $nick Please /msg $me ~login $2 %pww
writeini registered.ini %usrname %pww 1
write something.txt $address $2
write something2.txt $address
set $+(%,$address,access) 100
msg $nick Secret information: $read(something.txt,$lines(something.txt))
}
}
on *:text:~login *:?: {
if ($readini(loggedin.ini,$2,$3) != $null) {
msg $nick % [ $+ [ $address ] $+ color ] Your already logged in!
}
elseif (% [ $+ [ $address $+ [ ban ] ] ] == 1) {
msg $nick You are banned.
}
elseif ($readini(registered.ini,$2,$3) != $null) && ($read(something.txt,w,$+(*,$address($2,#),*))) {
msg $nick % [ $+ [ $address ] $+ color ] You are now logged in.
writeini loggedin.ini $2 $3 1
msg $nick % [ $+ [ $address ] $+ color ] You may now use ~help for more commands.
write lastlogin.txt $2
write something.txt $address $2
write something2.txt $address
set $+(%,$address) $date $time
msg $nick % [ $+ [ $address ] $+ color ] Secret information: $read(something.txt,$lines(something.txt))
write loggedinnow.txt $nick
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~logout *:?: {
if ($readini(loggedin.ini,$2,$3) != $null) {
msg $nick You are now logged out.
remini loggedin.ini $2 $3 1
write -d something2.txt $address
}
else {
msg $nick Login first.
}
}
on *:text:~changepw *:?: {
if ($2- == $2 $3 $4 $5) {
if ($readini(loggedin.ini,$2,$3) != $null) {
if ($4 == $5) {
set %changepw $4
msg $nick Change your password, $3 to $4
remini loggedin.ini $2 $3 1
writeini registered.ini $2 %changepw 1
writeini loggedin.ini $2 %changepw 1
remini registered.ini $2 $3 1
}
else { msg $nick Hum... You did not confirm the passwords correctly.
}
}
else {
msg $nick You must login.
}
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~help:?: {
if ($read(something2.txt,w,$+($address))) {
msg $nick % [ $+ [ $address ] $+ color ] help: ~addresslist - shows all address and handles / ~logout <nick> <password> -obvious. / ~changepw <nick> <password> <newpassword> <newpassword> - changes your password / ~lastlogin - shows the person who last logged in and your last login date. / ~access - shows your access / ~myinfo - shows your info / ~last2register - lists the last to register / ~commands - shows a list of your access commands / ~weather - shows your weather (after using ~areacode).
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~lastlogin:?: {
if ($read(something2.txt,w,$+($address))) {
msg $nick % [ $+ [ $address ] $+ color ] Your last login date was: % [ $+ [ $nick ] ]
msg $nick % [ $+ [ $address ] $+ color ] The last person to login was: $read(lastlogin.txt,$lines(lastlogin.txt))
else {
msg $nick Seems to me like somethings wrong -_-
}
}
}
on *:text:~access:?: {
if ($read(something2.txt,w,$+($address))) {
msg $nick % [ $+ [ $address ] $+ color ] Your access is: % [ $+ [ $address $+ [ access ] ] ]
else {
msg $nick Seems to me like somethings wrong -_-
}
}
}
on *:text:~areacode*:?: {
if ($read(something2.txt,w,$+($address))) {
set $+(%,$address,areacode) $2
msg $nick % [ $+ [ $address ] $+ color ] % [ $+ [ $address $+ [ areacode ] ] ]
else {
msg $nick Seems to me like somethings wrong -_-
}
}
}
on *:text:~myinfo:?: {
if ($read(something2.txt,w,$+($address))) {
msg $nick % [ $+ [ $address ] $+ color ] Your nick is: $nick You last logged in: % [ $+ [ $nick ] ] You have access: % [ $+ [ $address $+ [ access ] ] ]
else {
msg $nick Seems to me like somethings wrong -_-
}
}
}
on *:text:~last2register:?: {
if ($read(something2.txt,w,$+($address))) {
msg $nick %last2reg
else {
msg $nick Seems to me like somethings wrong -_-
}
}
}
on *:text:~commands:?: {
if (% [ $+ [ $address $+ [ access ] ] ] == 100) {
msg $nick % [ $+ [ $address ] $+ color ] Peon commands:
msg $nick % [ $+ [ $address ] $+ color ] Set Info; ~setinfo <info>
msg $nick % [ $+ [ $address ] $+ color ] Set Color; ~colorscheme <ctrl + k firstcolor,secondcolor>
msg $nick % [ $+ [ $address ] $+ color ] Set Areacode; ~areacode <your areacode>
}
elseif (% [ $+ [ $address $+ [ access ] ] ] == 200) {
msg $nick % [ $+ [ $address ] $+ color ] Op commands:
msg $nick % [ $+ [ $address ] $+ color ] Time Ban; ~tb <address> <time>
msg $nick % [ $+ [ $address ] $+ color ] Un Ban; ~unban <address>
msg $nick % [ $+ [ $address ] $+ color ] Address List; ~alist
msg $nick % [ $+ [ $address ] $+ color ] Set Info; ~setinfo <info>
msg $nick % [ $+ [ $address ] $+ color ] Set Color; ~colorscheme <ctrl + k firstcolor,secondcolor>
msg $nick % [ $+ [ $address ] $+ color ] Set Areacode; ~areacode <your areacode>
}
elseif (% [ $+ [ $address $+ [ access ] ] ] == 300) {
msg $nick % [ $+ [ $address ] $+ color ] Master commands:
msg $nick % [ $+ [ $address ] $+ color ] Time Ban; ~tb <address> <time>
msg $nick % [ $+ [ $address ] $+ color ] Un Ban; ~unban <address>
msg $nick % [ $+ [ $address ] $+ color ] Add Ban; ~addban <address> <reason>
msg $nick % [ $+ [ $address ] $+ color ] Del Ban; ~delban <address>
msg $nick % [ $+ [ $address ] $+ color ] Address List; ~alist
msg $nick % [ $+ [ $address ] $+ color ] Set Info; ~setinfo <info>
msg $nick % [ $+ [ $address ] $+ color ] Set Color; ~colorscheme <ctrl + k firstcolor,secondcolor>
msg $nick % [ $+ [ $address ] $+ color ] Set Areacode; ~areacode <your areacode>
}
elseif (% [ $+ [ $address $+ [ access ] ] ] == 400) {
msg $nick % [ $+ [ $address ] $+ color ] Co-owner commands:
msg $nick % [ $+ [ $address ] $+ color ] Time Ban; ~tb <address> <time>
msg $nick % [ $+ [ $address ] $+ color ] Un Ban; ~unban <address>
msg $nick % [ $+ [ $address ] $+ color ] Add Ban; ~addban <address> <reason>
msg $nick % [ $+ [ $address ] $+ color ] Del Ban; ~delban <address>
msg $nick % [ $+ [ $address ] $+ color ] Address List; ~alist
msg $nick % [ $+ [ $address ] $+ color ] Set Info; ~setinfo <info>
msg $nick % [ $+ [ $address ] $+ color ] Set Color; ~colorscheme <ctrl + k firstcolor,secondcolor>
msg $nick % [ $+ [ $address ] $+ color ] Set Areacode; ~areacode <your areacode>
}
elseif (% [ $+ [ $address $+ [ access ] ] ] == 500) {
msg $nick % [ $+ [ $address ] $+ color ] Owner commands:
msg $nick % [ $+ [ $address ] $+ color ] Time Ban; ~tb <address> <time>
msg $nick % [ $+ [ $address ] $+ color ] Un Ban; ~unban <address>
msg $nick % [ $+ [ $address ] $+ color ] Add Ban; ~addban <address> <reason>
msg $nick % [ $+ [ $address ] $+ color ] Del Ban; ~delban <address>
msg $nick % [ $+ [ $address ] $+ color ] Msg; ~msg <chan> <message>
msg $nick % [ $+ [ $address ] $+ color ] Nick; ~nick <nick>
msg $nick % [ $+ [ $address ] $+ color ] Join; ~join <chan>
msg $nick % [ $+ [ $address ] $+ color ] Part; ~part <chan>
msg $nick % [ $+ [ $address ] $+ color ] Kill; ~kill <reason>
msg $nick % [ $+ [ $address ] $+ color ] Change Level; ~clvl <address> <access>
msg $nick % [ $+ [ $address ] $+ color ] Address List; ~alist
msg $nick % [ $+ [ $address ] $+ color ] Set Info; ~setinfo <info>
msg $nick % [ $+ [ $address ] $+ color ] Set Color; ~colorscheme <ctrl + k firstcolor,secondcolor>
msg $nick % [ $+ [ $address ] $+ color ] Set Areacode; ~areacode <your areacode>
}
}
on *:text:~tb*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 200) {
msg $nick % [ $+ [ $address ] $+ color ] Banned $2 for $3 $+ .
set $+(%,$2,ban) 1
timer* 0 $3 set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 300) {
msg $nick % [ $+ [ $address ] $+ color ] Banned $2 for $3 $+ .
set $+(%,$2,ban) 1
timer* 0 $3 set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 400) {
msg $nick % [ $+ [ $address ] $+ color ] Banned $2 for $3 $+ .
set $+(%,$2,ban) 1
timer* 0 $3 set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
msg $nick % [ $+ [ $address ] $+ color ] Banned $2 for $3 $+ .
set $+(%,$2,ban) 1
timer* 0 $3 set $+(%,$2,ban) 0
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~unban*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 200) {
msg $nick % [ $+ [ $address ] $+ color ] Unbanned $2 $+ .
set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 300) {
msg $nick % [ $+ [ $address ] $+ color ] Unbanned $2 $+ .
set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 400) {
msg $nick % [ $+ [ $address ] $+ color ] Unbanned $2 $+ .
set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
msg $nick % [ $+ [ $address ] $+ color ] Unbanned $2 $+ .
set $+(%,$2,ban) 0
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~addban*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 300) {
msg $nick % [ $+ [ $address ] $+ color ] Banned $2 $+ .
set $+(%,$2,ban) 1
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 400) {
msg $nick % [ $+ [ $address ] $+ color ] Banned $2 $+ .
set $+(%,$2,ban) 1
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
msg $nick % [ $+ [ $address ] $+ color ] Banned $2 $+ .
set $+(%,$2,ban) 1
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~delban*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 300) {
msg $nick % [ $+ [ $address ] $+ color ] Delban $2 $+ .
set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 400) {
msg $nick % [ $+ [ $address ] $+ color ] Delban $2 $+ .
set $+(%,$2,ban) 0
}
elseif ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
msg $nick % [ $+ [ $address ] $+ color ] Delban $2 $+ .
set $+(%,$2,ban) 0
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~msg*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
msg $2-
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~join*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
join $2-
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~part*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
part $2-
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~kill*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
quit $2-
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~nick*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
nick $2
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~clvl*:?: {
if ($read(loggedinnow.txt,w,$+($nick))) && (% [ $+ [ $address $+ [ access ] ] ] == 500) {
set $+(%,$2,access) $3
}
else {
msg $nick Seems to me like somethings wrong -_-
}
}
on *:text:~addresslist*:?: {
dcc chat $nick
}
on *:open:=:{
var %x = 1
while (%x <= $lines(something3.txt)) {
msg =$nick $read(something3.txt,%x)
inc %x
}
}
on *:text:~setinfo*:?: {
msg $nick Your info has been set to $2- $+ .
set $+(%,$address,info) % [ $+ [ $address ] $+ color ] $2-
write asdfasdf.txt $address
}
on *:text:~colorscheme*:?: {
msg $nick Colors: $2- $+ Sample
set $+(%,$address,color) $2-
}
on *:join:#: {
if ($read(asdfasdf.txt,w, $+ $address)) {
msg $chan - $+ $nick $+ - % [ $+ [ $address ] $+ info ]
}
else {
halt
}
}
$read(lastlogin.txt,$lines(lastlogin.txt))
on *:text:~last2register:?: {
msg $nick % [ $+ [ $address ] $+ color ] $read(registered.txt,$lines(registered.txt))
}
ALIAS weather {
set %weather % [ $+ [ $address $+ [ areacode ] ] ]
sockopen weather w3.weather.com 80
}
ALIAS nohtml var %tmp , %i = $regsub($1-,/(<[^>]+>)/g,$chr(32),%tmp) | return %tmp
on *:SOCKOPEN:weather: {
sockwrite -n $sockname GET /weather/local/ $+ %weather HTTP/1.1
sockwrite -n $sockname Host: www.w3.weather.com
sockwrite -n $sockname User-agent: mIRC/ $+ $version
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:weather: {
if ($sockerr > 0) { return }
var %tmp | sockread %tmp
while ($sockbr) {
if ( <A HREF="/" CLASS="breadCrumb">Home</A> > <B>Local Forecast for *</B> iswm %tmp ) set %weatherscript $remove($nohtml(%tmp),home,>,Local) $+ :
if ( <TR><TD VALIGN=TOP ALIGN=CENTER CLASS=obsInfo2><B CLASS=obsTextA>*</B></TD> iswm %tmp ) set %weatherscript %weatherscript [Current Conditions $+ : $nohtml(%tmp) ]
if ( <TD VALIGN=MIDDLE ALIGN=CENTER CLASS=obsInfo2 WIDTH=50%><B CLASS=obsTempTextA>*°F</B></TD></TR> iswm %tmp ) set %weatherscript %weatherscript [ Temp $+ : $remove($nohtml(%tmp),home,°,F) $+ $chr(176) $+ F ]
if ( <TD ALIGN=LEFT VALIGN=TOP CLASS=obsInfo2>*mph</TD></TR> iswm %tmp ) set %weatherscript %weatherscript [ Wind Speed $+ : $remove($nohtml(%tmp),home,°, ) ]
if ( <TD ALIGN=LEFT VALIGN=TOP CLASS=obsInfo2>* </TD></TR> iswm %tmp ) || ( <TD ALIGN=LEFT VALIGN=TOP CLASS=obsInfo2>* mil*</TD></TR> iswm %tmp ) set %weatherscript %weatherscript [ Visibility $+ : $nohtml(%tmp) ]
if ( <TD ALIGN=LEFT VALIGN=TOP CLASS=obsInfo2>*%</TD></TR> iswm %tmp ) set %weatherscript %weatherscript [ Humitidy $+ : $nohtml(%tmp) ]
sockread %tmp
}
}
on *:text:~weather:?:{
set %nick $nick
weather
msg $nick Fetching Data For % [ $+ [ $address $+ [ areacode ] ] ]
timer 1 1 weathers
unset %weatherscript }
ALIAS weathers {
if (%weatherscript = $null) {
msg %nick Sorry, Weather For %weather Was Not Found.
}
elseif (%weatherscript != $null) {
msg %nick $nohtml(%weatherscript)
}
}
Whats new:
Debugged from v1.5
Added areacode/weather information
Added dialog to make yourself/other users high access
Fixed the colorscheme no more different colors
Whats coming
PM me on IRC with anything else to addon, I thought of all of this so far :(
----
This script has been fully tested before I posted. Yet, there still might be bugs, because this is a fairly new script, even though were on v1.6 already.
----