mIRC Homepage
Posted By: woOtat50Klicks Help a noobie out? - 28/02/06 10:05 AM
Hi, Sorry Completely noob here, so like it or lump it.

Basicly, I'd like to create a script so when someone in "this one" channel, says !servers, I automaticly send them a pm with a list of server ips, also !admin too and possibly a few other commands too, Could someone help (I remember using the "script Editor" in mIRC to do a similar sort of thing before.

Any help would be appreachiated
Posted By: RusselB Re: Help a noobie out? - 28/02/06 11:24 AM
Your question is very general, so my answer is also.

You seem to already know a bit about scripting, so the sections in the help file that you want to refer to are:
ON TEXT
/msg
/play

I'm going to presume that you have the server ip's in a text file, with one ip per line
Code:
 on *:text:!servers:#:{ .play $nick servers.txt } 
Posted By: woOtat50Klicks Re: Help a noobie out? - 28/02/06 11:31 AM
Hey thanks for your reply, thats very helpful, yeh I did some scripting about 3 years ago lol, Aint for a while.

Ah I see what you mean, looking thru the help file now, thanks ever so much mate.
Posted By: woOtat50Klicks Re: Help a noobie out? - 28/02/06 11:40 AM
Which tab do they need to be put in, the Popup tab or?

Other than the code you have given me, Do I need to learn/find/get anymore?
Posted By: Om3n Re: Help a noobie out? - 28/02/06 03:40 PM
Events should always be put in the remotes tab.
Posted By: woOtat50Klicks Re: Help a noobie out? - 28/02/06 04:08 PM
Hi Thanks, Yeh I'm well on my way now, Got a problem with this now:

Code:
on *:text:!adminneeded 01:%matchtext:%channel:#:{ /msg 


Not sure how to set this part out, I want it to pick up on the adminneeded then pick up say Team killer or something too. How do I do that, I tried so many diff ways without any joy.
Posted By: woOtat50Klicks Re: Help a noobie out? - 28/02/06 05:30 PM
Code:
on *:text:!adminneeded 01:'#: /msg #**** Admin requested by $nick on 16567 **** No. 01 (52 Player) at $asctime(hh:nn:ss) | /msg $nick Hey $nick , Your request has been received, The problem will be dealt with shortly }


I want to use this code and allow variables for it to pick up teamkiller, Attacking red circle etc.
Example: !adminneeded 01 Teamkiller
or
!adminneeded 01 Smack-Tard

How do I do that,

Been told to use the on 1:TEXT:%matchtext:%channel:/msg $nick You just said $1- on channel %channel

But I dont understand how to work them together to get the same result.
Posted By: Om3n Re: Help a noobie out? - 01/03/06 03:02 AM
Code:
on *:text:!adminneeded 01 %:'#: {
  if ($3 == Teamkiller) {
    msg #**** Admin requested by $nick on 16567 **** No. 01 (52 Player) at $asctime(hh:nn:ss)
    msg $nick Hey $nick , Your request has been received, The problem will be dealt with shortly
  }
  elseif ($3 == Smack-Tard) {
    ;code here
  }
}


$3 represents the third word in the line that was entered $1 = !adminneeded, $2 = 01, etc
Posted By: woOtat50Klicks Re: Help a noobie out? - 01/03/06 04:07 PM
Do I need to add anything to that or should it work straight away? dont seem to be working for me you see :]
Posted By: woOtat50Klicks Re: Help a noobie out? - 01/03/06 08:10 PM
Maybe if I gave more detail on want I want the script to allow.

basicly its a bot for a BF2 Commuinty, and I'd like people to be able to request a kick/report a smack tard or something via the irc channel, but not so the details are displayed in the main channel, but so there displayed in a .priv channel where the server admins would be..,

I was told by a friend to use Variables, so it picks up the text after the !adminneeded 1.

If you could help then that would be great :]
Posted By: Lpfix5 Re: Help a noobie out? - 01/03/06 09:13 PM
Basically im a little confused on what you want but this is what I think you need lets say we have channel A (main channel) and channel B (IRCOP Channel/Admin)

Bot is in A and B

;Keep in mind when i use second and third its anything you want it to be

someone from A types !adminneeded Jason Smacktard

bot sends a message too channel B where all the admins are at

script:> sypnosis basically I will allow this script

on *:TEXT:*:#:{
if ($1 == !adminneeded) { msg #channelB Help has been requested by $nick from channel $chan $+ , $2 is causing a problem, escallation reason $3 }
}

You see $1 equals to the first word someone says example !adminneeded then $2 is second word which is Jason and $3 well you get the point

so the bot messages the ChannelB and reports this fellow

but this should be enough scripts for you to work around here is a small exaplanation also of variables

set %OperatingSystem = $os
on *:TEXT:*:!uptime*:{ msg $chan My system has been up for $uptime(system,1) using Windows %OperatingSystem }

Basically what this script did is at first I set a variable and named it OperatingSystem and I used the command $os to find what Operating System im using so later on I could use it in the script if needed like I did (The variable I used in the script above is called a global variable once it is set its permanent till deleted or edited.

Next variable works something like this

on *:TEXT:!advertise*:#:{
var %script = I am currently using Script Var v1.2
msg $chan It is currently $time(HH:nn:ss) - %script
msg $chan %script can be downloaded at ...
msg $chan You will really enjoy %script
}

This is a temp Variable where its only used locally in the script that you run so what we did there basically is advertise I am currently using Script Var v1.2 three times in the script.

Now variables are not only great for shortning long words youll be using all the time but its also great too increment

alias mIRC {
var %x = 1
while (%x <= 10) {
echo -a Number: %x
inc %x
}
}

basically what this does is while %x is smaller or equal too 10 continue incrementing till 10 arrives so it will cound from number 1 to 10

So basically variables are great for storing long period information or one time periods.
Quote:
Maybe if I gave more detail on want I want the script to allow.

basicly its a bot for a BF2 Commuinty, and I'd like people to be able to request a kick/report a smack tard or something via the irc channel, but not so the details are displayed in the main channel, but so there displayed in a .priv channel where the server admins would be..,

I was told by a friend to use Variables, so it picks up the text after the !adminneeded 1.

If you could help then that would be great :]
Posted By: woOtat50Klicks Re: Help a noobie out? - 02/03/06 07:48 AM
Thats just spot on mate, Just what I needed, I've changed it a bit

Code:
on *:TEXT:*:#:{
  if ($1 == !adminneeded) { msg #CHAN An admin has been requested by $nick on **** $2 , Reason: $3 , $4 is the suspect - Requested at $asctime(hh:nn:ss)  (Channel: $chan) | msg $nick Hey $nick , Your request has been received, The problem will be dealt with shortly }
 


Which works great, as it picks up the server number and the reason plus the suspect :]

I'm not looking in to allowing a login for the bot and too allow the !op me commands, any suggestions for that?
© mIRC Discussion Forums