View Full Version : help :-p like u've never heard that be4!
ok, how would i make it so a remote script would only work for certain ppl
say like, if some1 says 'ops' then my remote script would send them a notice saying 'no :oP' unless it was a certain person, then it would just op them...
[Edit fixed the Smiley thing, just disable Smilies in the post in future]
[Edited by GameGuru on 20-07-2001 at 07:21 PM]
GameGuru
20-07-2001, 19:19
You need to create a user list, and allow only people at a certain user level to use commands such as op and voice.
Check the following areas in the mIRC help file: "Access List" or "User List" and "ON TEXT" event.
Be warned, since people can use any nickname on Quakenet its very easy to abuse the user list (since people can use someone's nickname freely as long as it isn't currently in use) unless the user is on a static hostname/ip address. in which case you can add that.
HTH
ok, nuva question....
this time i'm making a bot! :-)
how would i make it not d/c thru a ping timeout??
oh and i forgot.... ummm... where exactly should i start??
this is my first bot! :-p i wanna get it right!
GameGuru
22-07-2001, 22:37
If you mean, how can I stay connected to an IRC server even if my internet connection fails (i.e. I get disconnected) then the simple answer is you can't.
Channel protection bots have to be connected to the internet all the time in order to keep hold of a channel.
However, if you still wanna create a bot then you can just make use of mIRC's user list and and dynamic variables for storing passwords performed by setting a variable like this:
;example account creation and auth routine
;Syntax for making an account: /msg <nickname> mkacct <password>
;Your current nickname will become your auth name
on *:TEXT:mkacct*:?: {
if ( $2 == $null ) { msg $nick Error, you need to set a password to create an account }
elseif ( %user. [ $+ [ $nick ] ] != $null ) { msg $nick A username matching your nick already exists, if it is you please auth using /msg $me auth username password }
else { %user. [ $+ [ $nick ] ] = $2 | msg $nick An account has been created for you, username: $nick password: %user. [ $+ [ $nick ] ] }
}
;Syntax for authing with bot: /msg <nickname> auth username password
on *:TEXT:auth*:?: {
if (( $2 == $null ) || ( $3 == $null )) { msg $nick you forgot your username and/or password. Syntax: /msg $me auth username password }
elseif ( %user. [ $+ [ $2 ] ] == $null ) { msg $nick No such user exists, try making an account first: /msg $me mkacct password }
elseif ( $3 != %user. [ $+ [ $2 ] ] ) { msg $nick Your password does not match the username specified, check both your password and username for mistakes and try again }
else { msg $nick Auth was successful }
}
All the code does is create an account and check the username and password, you'll notice nothing is actually performed once an auth is made, but this is just a basis to work from :)
hmmm, it's just that on bots u can d/l, they have something to stop them from d/c thru a ping timeout!!
but ty very much! :-)
ohyeah, once they've authed, how will the bot know what access level they have.... i mean, how do u give a person an access level?? (ok, i know that, u do it in the user list...) but i only really know how to do that for nicks (without them authing or anything...)
[Edited by Krenom on 23-07-2001 at 07:46 AM]
GameGuru
23-07-2001, 14:52
Well, it starts to get more complex now, I don't want to write too much more code, otherwise I've made a bot for you :)
You'll need to add the user levels manually. You could write code that does this for you... for instance, when that person is authed, create a variable of the nickname of the authed person, and then store the username of the person in it.
Once you've done that, write some code so that if you, or an admin says "add op" or similar. The bot would add the current username to its oplist for the channel (obviously you would need make sure that the bot would check the channel before opping that person, but thats something for you to think about) this can be done with the command /auser (check the helpfile for detailed info. You will need to do a lot of storing of variables to keep track of userlevels (since mIRC only regards userlevels by current address and/or nicknames) and also who is authed and who isn't.
Bots in mIRC that are designed to look after channels can be hard work to create, but it is probably the best way to get used to scripting.
If you have a link to a bot that can stay connected even when you disconnect from the net, pass me a link. I'll have a look to see how it does it.
wuaffiliate
23-07-2001, 15:59
ive been working on my bot with lots of help from m8s, took me 2 weeks to get it running perfectly with no bugz, now i just need to add the refined cmds od egdrops ;)
awww... i was hoping i could keep asking questions in no particular order so u wouldn't notice u were the one technically building my bot! ;-)
ohwell...
hmmm... variables... i haven't really bothered about learning those proply yet... nows a good a time as any i spose! ;-)
oh yeah.. with the bot i d/l.. it had a few .ini files and the other day when i asked some1 for help with something, he asked me if i knew how to use em... wot significance (ooo big word!) do they have?
GameGuru
23-07-2001, 16:55
mIRC scripts are made up of ini or mrc filetypes. mrc are plain text files which mIRC knows are specific script files whereas ini files are in this format for mIRC scripts when opened in a text editor:
n0=/op /mode # +ooo $$1 $2 $3
n1=/dop /mode # -ooo $$1 $2 $3
So in answer to your question, they are the scripts and therefore are significant :)
Default ini names for mIRC files:
Aliases.ini = Alias file
Popups.ini = Popups file
Script.ini = Remote Script file
Remote.ini = Users & Variables file
thought so... ;-)
how do u make mIRC use the file thingies tho??
when u edit the remote scripts for example, ur editing the remote.ini or wotever it is and same with the others. but how would u make mIRC use another/different .ini file for some other script type thing u've done...
GameGuru
23-07-2001, 23:23
Do the following to add a remote script to mIRC:
Press Alt + R to load the Remote Script in mIRC editor or click on the Remote Scripts button
Press Alt + F or click File
Press L or click Load
Press S or click Script
Then all you have to do is tell mIRC where it is.
ah.. ty! :-)
now.. i just have to think up another question for u to answer.....
hmm, nope.. i'm all out for now! :-p
oh, ok.. now i got one! ;-)
ok, once some1 has authed with the bot, how exactly would it recognise it??
e.g. if some1 gave the command to op them, and they weren't authed, the bot would say no. but if they were authed, it would op them...
and also, how do u give ppl with accounts an access level w/o putting them in the user list... (if at all possible)
GameGuru
26-07-2001, 23:10
You're tough to please :)
ok, once some1 has authed with the bot, how exactly would it recognise it??
Perhaps make the bot set an auth variable with the bot, for example %auth.username $nick
so if that person auths it makes a variable with the username and their current nick as the contents of the variable. Just make sure you unset the variable when they quit or leave.
e.g. if some1 gave the command to op them, and they weren't authed, the bot would say no. but if they were authed, it would op them...
This would require you to check the auth variable as mentioned above :) if it exists and the nickname matches then you can consider them authed.
and also, how do u give ppl with accounts an access level w/o putting them in the user list... (if at all possible)
You could use a text file, which would store a username and their access level...
I've tried to be a general as possible, because if I tell you everything there's little to gain from scripting.
heh heh.. i believe the term is 'minimalist'! ;-)
jj :-p
ty
my bot is practically finished now! ;-) just gotta make a few improvements!
well..come one! , show us ya work!!!
wot do u mean show u meh work??? u want me to paste the big long script??
heh.. sounds like some1 wants to nick meh scripting work! ;-) jj
i think it would be a little big to paste in here really...
GameGuru
29-07-2001, 18:24
I believe Chronic is banned now anyway, so I doubt he can complain about not seeing it. If you'd rather not paste it then fair enough. But if you do want to, make a new thread and warn us about the length in the topic :)
hmmmm.. meh script really is pretty simple.... and i feel kinda bad that i didn't include the authing with it.. after all that help u've give me with it! it was just too complicated... :-/
on tope of all that.. i just can't be arsed! :-p
GameGuru
30-07-2001, 00:18
I don't expect people to be able to produce mind blowingly brilliant scripts when they lack the experience, if you've learned something from what you've done and gained enough confidence to keep scripting then that's all that matters, I don't mind giving out help for people who want to learn scripting, whether they use it or not is up to them. :)
ok.. i'll post it when i have time... but that's not now! :-( i gtg! :-p
Well , i mean , upload it or something, not paste in here, its probably massive :O
wuaffiliate
31-07-2001, 08:35
my bot code isnt really massive. go to #wpirc and show us how it works :)
mines fairly big , but its loaded with bar stuff and lame sheet :O
wuaffiliate
31-07-2001, 09:09
hehe, i just wanted mine to be very easy and just a utility bot
-WM-llyama
03-08-2001, 17:29
ok, i am a moderate scripter, not a total newb, but far from being a good scripter
i have just finished a new away script, you can get it here (http://homepage.ntlworld.com/thecrosses/llyama-away.zip)
i think it uses to many variables, but i don't know how to use hash tables yet :(
anyways tell me what yer think....
ok on to the main reason i posted
me and a friend are making a bot this weekend, with any luck :)
and i was looking at the auth code above, now what i don't understand, is the use of evaluation brackets, i have looked in the help file, and still can't grasp it.
can you explain to me what they do? and it says that double brackets [[%test]] would make it re-evaluate the variable, how does it know where to evaluate from? if that makes sense?
and one last thing... what does || do? i know what a single one does, "|" but not a double, does it work as an OR?
any help/feedback appreciated :)
[Edited by -WM-llyama on 03-08-2001 at 05:34 PM]
GameGuru
03-08-2001, 19:53
I'm not too sure how the evaluation brackets work, unfortunately mIRC doesn't work very well with them, hence the reason you have to double evaluate with them sometimes...
However, I know that afaik identifiers go, u want to double evaluate when the identifier is checked multiple times, for example when using $time. I know its a poor explanation but its awkward, the best thing to do is experiment and when you find it works leave it alone :)
You are right in saying the || represents Or in an if-then-else statement.
-WM-llyama
03-08-2001, 23:27
%user. [ $+ [ $nick ] ] != $null
Now... i understand what this does, it checks to see if the users nickname is in %user. by not returning $null
but i don't understand how it does it
is the . at the end of %user just the name of the variable? or does it mean something
what i am saying is how does [ $+ [ $nick ] ] work?
GameGuru
03-08-2001, 23:46
ok, I've obviously confused you so I'll explain how it works :)
the [ $+ [ $nick ] ] allows mIRC to make a "dynamic" variable. When I say dynamic, I mean that if a different person triggered the event the outcome would be different to anyone elses' outcome. All the [ $+ [ $nick ] ] does is evaluate $nick (the nickname of the person triggering the script) and put it on the end of the variable. The . is insignificant and not necessary, but I always seperate a static part of the variable (the "user" bit) from the dynamic part ($nick) with a .
So, if someone was to msg my bot with an auth command the bot would make the variable %user.someone username
Hope that clears up any confusion (if not u know what to do :))
-WM-llyama
04-08-2001, 09:43
hmmm *scratches head*
i thought it checked %user. for the nickname, and if not added it to a variable %user. hmm but it doesnt' it creates a seperate variable for each user yes?
i still don't understand how [ $+ [ $nick ] ] does it though lol
:/
-WM-llyama
04-08-2001, 09:57
/sayvar /say % [ $+ [ $1 ] ]
now when someone types /sayvar hello it creates a variable called %hello
but i don't get how it does it :/
GameGuru
04-08-2001, 15:25
Originally posted by -WM-llyama
i thought it checked %user. for the nickname, and if not added it to a variable %user. hmm but it doesnt' it creates a seperate variable for each user yes?
Yes :)
If u evaluate $nick once (which should be sufficient) you will find the variable won't work, however if you evaluate it again, it does work. That's the only reason for the double evaluation brackets. I think what mIRC does with $1 and other variables like $time is that it evaluates it once and then just uses that outcome, if you evaluate twice then it keeps evaluating it each time making sure that it stays up to date.
ooo, ok.. i have another question!!
cos my isp d/c after every hour :-/ when i log back on to irc, my old nick is still there and i have to wait for it to ping timeout..
is there a remote script that i can have so that when my old nick ping timeouts my nick will change back??
or at least a nice easy base that i can simply work on? :-p
GameGuru
05-08-2001, 19:55
on *:QUIT: {
if ( $nick == Krenom ) { nick Krenom }
}
That should do it...
-WM-llyama
06-08-2001, 15:38
ok me and a friend are making a bot :)
the hardest part we have come across is storing all the usernames, and if they are AUTH'd etc etc
we looked at using Variables, INI files, User lists, and Hash tables
we decided to go for hash tables, which i now think was a wrong decision, we got everything working fine, you could create accounts and auth and change password etc fine
but now we are getting onto the later things like Auto-ops, hash tables just aren't working.
I thought changing it to using User lists, and having certain levels for certain things like auto ops, auto voice etc
would this be easy to do? we need to do everything by hostname, which is the hard part, and need to check weather people are authed or not
all i am trying to say is, what is the best way we can store hostnames, usernames and their privlidges. So they can be overwritten and changed easiest
hash tables are proving problematic when writing things to them, although they do work, it is getting more and more complicated
Thanks for any info :)
P.S. The forums are shutting down on Friday right? Where are you guys go?
GameGuru
06-08-2001, 17:17
Personally I'm not a big fan of Hash Tables, I much prefer using Text Files and Variables to store things, although it does become messy its certainly easier :)
I'm currently working on auth code which allows creation of userlevels through hostnames. If you check the other Thread titled "Making a Bot" later this evening, you will find some auth code which is probably what you are looking for :)
As for the forums going down Friday, hopefully they won't be down too long but I'll try my hardest to be on IRC for the duration of the forum downtime, so if you need further help, once the forums are down, you can see me in #wpirc
-WM-llyama
07-08-2001, 13:22
cool thx m8 i'll pop in :)
/me looks up how to store things in text files.....
just $read and /write ?!?
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.