mIRC Homepage
Posted By: DaBigBadShow help with saving names to ini file - 23/02/13 10:16 AM
when i add try and add users thru the bot is doesnt save name to ini file but if i add them manually the bot recognises them any help would be helpful.
Quote:

on *:load: {
echo -a 4A5nd a reminder12,4I 5must have owner status in a room to use some of these commands12!
set %botpw $$?="Enter Your Bots Password"
set %superowners $$?="Enter Your Bot Owners. Ex: superowner1,superowner2,superowner3"
set %superowner $$?="Enter the nick of the orginal superowner of your bot."
/auser superowner %superowner
}

#botscript on

on owner:TEXT:*:#: {
Tokenize 32 $Strip($1-)
if ($1 == .hop) { msg chanserv hop $chan add $2 }
if ($1 == .logout) { mode $chan -o $2 } { mode $chan +v $2 }
if ($1 == .login) { mode $chan -v $2 } { mode $chan +o $2 }
if ($1 == .op) { mode $chan +o $2 }
if ($1 == .aop) { msg chanserv aop $chan add $2 }
if ($1 == .sop) { msg chanserv sop $chan add $2 }
if ($1 == .mode) { mode $chan $2 }
if ($1 == .deop) { mode $chan -o $2 }
if ($1 == .partall) { partall }
if ($1 == .vop) { msg chanserv vop $chan add $2 }
if ($1 == .voice) { mode $chan +v $2 }
if ($1 == .devoice) { mode $chan -v $2 }
if ($1 == .halfop) { mode $chan +h $2 }
if ($1 == .dehalfop) { mode $chan -h $2 }
if ($1 == .protect) { mode $chan +a $2 }
if ($1 == .deprotect) { mode $chan -a $2 }
if ($1 == .owner) { mode $chan +q $2 }
if ($1 == .deowner) { mode $chan -q $2 }
if ($1 == .part) { /part $chan }
if ($1 == .hop) { hop $chan }
if ($1 == .partall) { partall }
if ($1 == .d/c) { disconnect }
if ($1 == .r/c) { timer 1 1 /amsg Restarting | timer -o 1 3 server %server }
if ($1 == .addowner) { auser owner $address($2,4) | notice $nick 4I 5have added 11 $2 5 to the owner list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Owner. Bot Command used in: $chan }
if ($1 == .addmaster) { auser master $address($2,4) | notice $nick 4I 5have added 11 $2 5 to the master list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Master. Bot Command used in: $chan }
if ($1 == .addoperator) { auser operator $address($2,3) | notice $nick 11 $2 5 is now a 4B5ot 4O5perator4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Operator. Bot Command used in: $chan }
if ($1 == .adduser) { auser user $address($2,3) | notice $nick 11 $2 5 is now on the 4B5ot 4U5sers list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot User. Bot Command used in: $chan }
if ($1 == .delowner) { ruser owner $address($2,3) | notice $nick11 $nick 5 has deleted 11 $2 5 from the owner list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot Owner. Bot Command used in: $chan }
if ($1 == .cn) { nick $2 }
if ($1 == .ban) { mode $chan +bb $2 $address($2,2) | kick $chan $2 $3- }
if ($1 == .delmaster) { ruser master $address($2,3) | notice $nick 11 $2 5has been deleted from the master list4.
.notice %superowners Warning: $nick has deleted $2 off of the User list as a Bot Master. Bot Command used in: $chan }
if ($1 == .deloperator) { ruser operator $address($2,3) | notice $nick 11 $2 5has been deleted from the operator list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot Operator. Bot Command used in: $chan }
if ($1 == .deluser) { ruser user $address($2,3) | notice $nick 11 $2 5has been deleted from the bot's user list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot User. Bot Command used in: $chan }
if ($1 == .invite) { invite $2 $chan }
if ($1 == .owners) { msg $chan %owner %users }
if ($1 == .ownercmds) { .notice $nick My owner commands are (.vop .aop .sop .mute .op, .mode, .kb, vop(auto voice), .ban, .deop, .voice, .devoice, .halfop, .dehalfop, .d/c, .hop, .part, .deowner, .owner, .addowner, .delowner, .addmaster, .delmaster, .addoperator, .deloperator, .adduser, .deluser, .join(in notice), .cn(change nick), .invite, .r/c, .id( in notice, .kick) }
if ($1 == .kick) { kick $chan $2 $3- }
if ($1 == .mastercmds) { .notice $nick My Master Commands are:.vop .aop .sop .mute .op, .deop, .voice, .devoice, vop(auto voice), .halfop, .dehalfop, .addoperator, .adduser, .ban, .kick, .kb, .invite, .deloperator, .deluser }
if ($1 == .kb) { kick $chan $2 $3- | ban $chan $address($2,2) }
if ($1- == explain yourself $me) { timer 1 1 msg $chan Yes $nick | timer 1 3 msg $chan I am a bot, my Super Owners are %superowners , i am in the beta stages, i am using NNS..and i like pie :P }
if ($1 == .operatorcmds) { .notice $nick My Operator Commands are:.vop .aop .sop .mute .voice, .devoice, .halfop, .dehalfop, vop(auto voice), .op, .deop, .kick, .ban, .kb }
if ($1 == .usercmds) { .notice $nick My User Comamnds are: .voice, .devoice, .kick, .mode, .hop, invite }
}

on owner:notice:*:*: {
if ($1 == .join) { /join $2 }
if ($1 == .id) { identify $2- }
}

on master:text:*:#: {
Tokenize 32 $Strip($1-)
if ($1 == .logout) { mode $chan -o $2 } { mode $chan +v $2 }
if ($1 == .login) { mode $chan -v $2 } { mode $chan +o $2 }
if ($1 == .op) { mode $chan +o $2 }
if ($1 == .deop) { mode $chan -o $2 }
if ($1 == .voice) { mode $chan +v $2 }
if ($1 == .devoice) { mode $chan -v $2 }
if ($1 == .halfop) { mode $chan +h $2 }
if ($1 == .dehalfop) { mode $chan -h $2 }
if ($1 == .vop) { msg chanserv vop $chan add $2 }
if ($1 == .addoperator) { auser operator $address($2,3) | notice $nick 11 $2 5 is now a 4B5ot 4O5perator4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Operator. Bot Command used in: $chan }
if ($1 == .ban) { mode $chan +bb $2 $address($2,2) | kick $chan $2 $3- }
if ($1 == .deloperator) { ruser operator $address($2,3) | notice $nick 11 $2 5has been deleted from the operator list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot Operator. Bot Command used in: $chan }
if ($1 == .deluser) { ruser user $address($2,3) | notice $nick 11 $2 5has been deleted from the bot's user list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot User. Bot Command used in: $chan }
if ($1 == .kick) { kick $chan $2 $3- }
if ($1 == .kb) { kick $chan $2 $3- | ban $chan $address($2,2) }
if ($1 == .mastercmds) { .notice $nick My Master Commands are: .op, .mode, .deop, vop(auto voice), .voice, .devoice, .halfop, .dehalfop, .ban, .kick, .kb, }
}

on operator:text:*:#: {
Tokenize 32 $Strip($1-)
if ($1 == .logout) { mode $chan -o $2 } { mode $chan +v $2 }
if ($1 == .login) { mode $chan -v $2 } { mode $chan +o $2 }
if ($1 == .voice) { mode $chan +v $2 }
if ($1 == .devoice) { mode $chan -v $2 }
if ($1 == .halfop) { mode $chan +h $2 }
if ($1 == .dehalfop) { mode $chan -h $2 }
if ($1 == .vop) { msg chanserv vop $chan add $2 }
if ($1 == .op) { mode $chan +o $2 }
if ($1 == .deop) { mode $chan -o $2 }
if ($1 == .invite) { invite $2 $chan }
if ($1 == .kick) { kick $chan $2 $3- }
if ($1 == .ban) { mode $chan +b $address($2,2) }
if ($1 == .kb) { mode $chan +b $address($2,2) | kick $chan $2 $3- }
if ($1 == .operatorcmds) { .notice $nick My Operator Commands are: .voice, .devoice, vop(auto voice), .halfop, .dehalfop, .op, .deop, .invite, .kick, .mode, .ban, .kb, }
}

on user:text:*:#: {
Tokenize 32 $Strip($1-)
if ($1 == .logout) { mode $chan -h $2 } { mode $chan +v $2 }
if ($1 == .login) { mode $chan -v $2 } { mode $chan +h $2 }
if ($1 == .voice) { mode $chan +v $2 }
if ($1 == .devoice) { mode $chan -v $2 }
if ($1 == .kick) { kick $chan $2 $3- }
if ($1 == .mode) { mode $chan $2 }
if ($1 == .invite) { invite $2 $chan }
if ($1 == .usercmds) { .notice $nick My User Comamnds are: .voice, .devoice, .kick, .mode, .hop, .invite }
}
on !superowner:join:#: { msg $chan 4,1W5,1elcome back 4 $+ $nick $+ 12,1, 5,1you are one of my 4,1S5,1uper 4,1O5,1wners $+ 12,1.
}
on owner:join:#: { msg $chan 4,1W5,1elcome back 4 $+ $nick $+ 12,1, 5,1you are one of my 4,1O5,1wners $+ 12,1.
}

on master:join:#: { msg $chan 4,1W5,1elcome back 4 $+ $nick $+ 12,1, 5,1you are one of my 4,1M5,1asters $+ 12,1.
}

on operator:join:#: { msg $chan 4,1W5,1elcome back 4 $+ $nick $+ 12,1, 5,1you are one of my 4,1O5,1perators $+ 12,1.
}

on user:join:#: { msg $chan 4,1W5,1elcome back 4 $+ $nick $+ 12,1, 5,1you are one of my 4,1B5,1ot 4,1U5,1sers $+ 12,1.
}

#botscript end

on !superowner:text:*:#: {
Tokenize 32 $Strip($1-)
if ($1- == return to safe mode) { amsg 4B5ot is returning to 4S5afe 4M5ode 10[4C5ommand used by 4S5uper 4O5wner10: 4 $nick 10] | /enable #botscript }
if ($1- == bot lockdown) { amsg 4B5ot 4L5ock 4D5own has be activated 10[4C5ommand used by 4S5uper 4O5wner10: 4 $nick 10] | /disable #botscript }
if ($1 == .op) { mode $chan +o $2 }
if ($1 == .aop) { msg chanserv aop $chan add $2 }
if ($1 == .sop) { msg chanserv sop $chan add $2 }
if ($1 == .logout) { mode $chan -o $2 } { mode $chan +v $2 }
if ($1 == .login) { mode $chan -v $2 } { mode $chan +o $2 }
if ($1 == .deop) { mode $chan -o $2 }
if ($1 == .mode) { mode $chan $2 }
if ($1 == .vop) { msg chanserv vop $chan add $2 }
if ($1 == .partall) { partall }
if ($1 == .addsuperowner) { auser superowner $address($2,3) | notice $nick 4 $+ $2 5 has been added to my 4S5uper 4O5wner list2.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Super Owner. Bot Command used in: $chan }
if ($1 == .delsuperowner) { ruser superowner $address($2,3) | notice $nick 4 $+ $2 5has been deleted off of my 4S5uper 4O5wner list2.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot Super Owner. Bot Command used in: $chan }
if ($1 == .voice) { mode $chan +v $2 }
if ($1 == .devoice) { mode $chan -v $2 }
if ($1 == .halfop) { mode $chan +h $2 }
if ($1 == .dehalfop) { mode $chan -h $2 }
if ($1 == .protect) { mode $chan +a $2 }
if ($1 == .deprotect) { mode $chan -a $2 }
if ($1 == .owner) { mode $chan +q $2 }
if ($1 == .deowner) { mode $chan -q $2 }
if ($1 == .part) { /part $chan }
if ($1 == .hop) { msg chanserv hop $chan add $2 }
if ($1 == .d/c) { disconnect }
if ($1 == .r/c) { timer 1 1 /amsg Restarting | timer -o 1 3 server %server }
if ($1 == .addowner) { auser owner $address($2,3) | notice $nick 4I 5have added 11 $2 5 to the owner list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Owner. Bot Command used in: $chan }
if ($1 == .addmaster) { auser master $address($2,3) | notice $nick 4I 5have added 11 $2 5 to the master list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Master. Bot Command used in: $chan }
if ($1 == .addoperator) { auser operator $address($2,3) | notice $nick 11 $2 5 is now a 4B5ot 4O5perator4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Operator. Bot Command used in: $chan }
if ($1 == .adduser) { auser user $address($2,3) | notice $nick 11 $2 5 is now on the 4B5ot 4U5sers list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot User. Bot Command used in: $chan }
if ($1 == .delowner) { ruser owner $address($2,3) | notice $nick 11 $nick 5 has deleted 11 $2 5 from the owner list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot Owner. Bot Command used in: $chan }
if ($1 == .cn) { nick $2 }
if ($1 == .ban) { mode $chan +bb $2 $address($2,2) | kick $chan $2 $3- }
if ($1 == .delmaster) { ruser master $address($2,3) | notice $nick 11 $2 5has been deleted from the master list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot Master. Bot Command used in: $chan }
if ($1 == .deloperator) { ruser operator $address($2,3) | notice $nick 11 $2 5has been deleted from the operator list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot Operator. Bot Command used in: $chan }
if ($1 == .deluser) { ruser user $address($2,3) | notice $nick 11 $2 5has been deleted from the bot's user list4.
.notice %superowners Warning: $nick has deleted $2 off of User list as a Bot User. Bot Command used in: $chan }
if ($1 == .invite) { invite $2 $chan }
if ($1 == .superownercmds) { .notice $nick My Super Owner commands are ( .vop .aop .sop .mute .op, .obliterate( drops nick groub), .release, .mode, .delsuperowner, .totalreset, .addsuperowner, .getpass, bot lockdown, return to safe mode .kb, .ban, .deop, .voice, .devoice, .vop(auto voice), .halfop, .dehalfop, .d/c, .hop, .part, .deowner, .owner, .addowner, .delowner, .addmaster, .delmaster, .addoperator, .deloperator, .adduser, .deluser, .join(in notice), .cn(change nick), .invite, .r/c, .id(notice).kick }
if ($1 == .ownercmds) { .notice $nick My owner commands are ( .vop .aop .sop .mute .op, .kb, .mode, .getpass, .ban, .deop, .voice, .devoice, .halfop, .dehalfop, .d/c, .hop, .part, .deowner, .owner, .addowner, .delowner, .addmaster, .delmaster, .addoperator, .deloperator, .adduser, .deluser, .join(in notice), .cn(change nick), .invite, .r/c, .id(in notice), .kick) }
if ($1 == .kick) { kick $chan $2 $3- }
if ($1 == .mastercmds) { .notice $nick My Master Commands are: .op, .mode, .deop, .voice, .devoice, vop(auto voice), .halfop, .dehalfop, .protect, .deprotect, .hop, .addoperator, .adduser, .ban, .kick, .kb, .invite, .deloperator, .deluser }
if ($1 == .kb) { mode $chan +b $address($2,2) | kick $chan $2 $3- }
if ($1- == explain yourself $me) { timer 1 1 msg $chan Yes $nick | timer 1 3 msg $chan I am a bot, my Super Owners are %superowners , i am in the beta stages, i am using NNS..and i like pie :P }
if ($1 == .operatorcmds) { .notice $nick My Operator Commands are: .voice, .devoice, .halfop, .dehalfop, .op, .deop, .invite, .kick, .mode, .ban, .kb, .hop }
if ($1 == .usercmds) { .notice $nick My User Comamnds are: .voice, .devoice, .kick, .mode, .hop, invite }
if ($1 == .obliterate) { /msg nickserv drop $me | msg $chan I have been obliterated }
}

on superowner:notice:*:*: {
if ($1 == .release) { ns release $2 $3 }
if ($1 == .join) { /join $2 }
if ($1 == .id) { identify $2- }
if ($1 == .totalreset) { /msg nickserv set password $2- | notice %superowners 4B5ot passwords have been changed by 4S5uper O5wner: 4 $nick to : $2- | set %botpw $2 }
if ($1 == .release) { ns release $me $2 }
if ($1 == .msg) { msg $2 $3-
}
}


]
Posted By: hixxy Re: help with saving names to ini file - 23/02/13 11:34 AM
Can you post the part that isn't working? We don't need to see the whole thing.

Cheers
Posted By: DaBigBadShow Re: help with saving names to ini file - 23/02/13 01:25 PM
sure sorry about that. Says it suppose to save to user.ini right but when it first starts it saves to users.ini and i cant add thru .adduser
Quote:
set %superowners $$?="Enter Your Bot Owners. Ex: superowner1,superowner2,superowner3"
set %superowner $$?="Enter the nick of the orginal superowner of your bot."
/auser superowner %superowner

if ($1 == .addsuperowner) { auser superowner $address($2,3) | notice $nick 4 $+ $2 5 has been added to my 4S5uper 4O5wner list2.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Super Owner. Bot Command used in: $chan }
if ($1 == .addowner) { auser owner $address($2,3) | notice $nick 4I 5have added 11 $2 5 to the owner list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Owner. Bot Command used in: $chan }
if ($1 == .addmaster) { auser master $address($2,3) | notice $nick 4I 5have added 11 $2 5 to the master list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Master. Bot Command used in: $chan }
if ($1 == .addoperator) { auser operator $address($2,3) | notice $nick 11 $2 5 is now a 4B5ot 4O5perator4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot Operator. Bot Command used in: $chan }
if ($1 == .adduser) { auser user $address($2,3) | notice $nick 11 $2 5 is now on the 4B5ot 4U5sers list4.
.notice %superowners Warning: $nick has added $2 to the User list as a Bot User. Bot Command used in: $chan }
Posted By: Deega Re: help with saving names to ini file - 23/02/13 02:23 PM
Is there any error message, such as /auser: insufficient parameters, after using the command?

Try using the 'guser' command instead of 'auser'

Code:
  if ($1 == .adduser) {
    guser user $2 3
    notice $nick 11 $2 5 is now on the 4B5ot 4U5sers list4.
  }


/auser relies on the address being in the IAL already
/guser forces mIRC to look the address up via /userhost.

And as sparta suggested, use code tags not quotes wink
Posted By: DaBigBadShow Re: help with saving names to ini file - 23/02/13 04:15 PM
I went in and deleted every one's names and the guser didn't work auser gave the same error

Code:
/guser: insufficient parameters (line 151, lovers-leap opt)
Posted By: Deega Re: help with saving names to ini file - 23/02/13 04:49 PM
Then it mustn't be being passed a valid nick. That's the error from something like "/guser user" (with no nick).

The command to the bot should be .adduser <nick>

Code:
  if ($1 == .adduser) {
    echo -a .adduser command used with : $1 -- $2-
    guser user $2 3
    notice $nick 11 $2 5 is now on the 4B5ot 4U5sers list4.
  }
Posted By: DaBigBadShow Re: help with saving names to ini file - 23/02/13 10:12 PM
its adding isp's not names so it think others are bot users
Posted By: Deega Re: help with saving names to ini file - 24/02/13 01:27 AM
Well personally, I would change all the auser level $address($2,3) to guser level $2 3 $2
and ruser level $address($2,3) to ruser level $2 3

There is also a couple of $address($2,4) = guser level $2 4 $2 and ruser level $2 4

This adds users in the form level:*!*ident@*.host.net NICK
The NICK at the end is an info parameter, this can be used as a way to (visually) see who the address actually belongs to - you can also refer to this thru $ulist().info to find users matching entries.

This does add users by address masks not their nicks, but I'm not actually sure what you mean by "so it think others are bot users"
Posted By: DaBigBadShow Re: help with saving names to ini file - 24/02/13 01:54 AM
instead of adding this to the ini file which is the persons hostname
Code:
ewc-4bbd4fe1.ga.comcast.net

it adds this
Code:
ga.comcast.net

and wnyone with that same isp can use the bot
Posted By: Deega Re: help with saving names to ini file - 24/02/13 02:55 AM
/guser <level> <nick> 3 <nick> adds the exact same address mask as $address(<nick>,3) (*!*user@*.host) See/help $mask for a list of the types.
Posted By: DaBigBadShow Re: help with saving names to ini file - 24/02/13 10:28 PM
thanks i got it working and thanks for all your help
© mIRC Discussion Forums