UNITED Radio Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.


A Happy Place is a Nice Place to Be [[R.I.P Sean]]
 
HomeHome  PortalPortal  GalleryGallery  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  
Latest topics
» Hello United Radio friends
Super Basic If-Then-Else I_icon_minitimeTue Jan 29, 2013 6:24 am by Fang54

» Weekly DJ Schedule
Super Basic If-Then-Else I_icon_minitimeTue Jan 29, 2013 5:12 am by Fang54

» Guess the Radio Babies
Super Basic If-Then-Else I_icon_minitimeFri Jan 21, 2011 11:43 pm by NetChick

» Quotes
Super Basic If-Then-Else I_icon_minitimeMon Dec 06, 2010 1:51 pm by mum

» Forum's Back
Super Basic If-Then-Else I_icon_minitimeTue Oct 05, 2010 4:01 pm by mum

» The Digital Economy Act 2010
Super Basic If-Then-Else I_icon_minitimeThu Apr 29, 2010 1:57 pm by casper

» Pics. :)
Super Basic If-Then-Else I_icon_minitimeTue Apr 06, 2010 7:27 pm by Laurapooh

» So You Think You Can Be A DJ?
Super Basic If-Then-Else I_icon_minitimeTue Feb 23, 2010 2:46 pm by SPAWN

» mIRC help
Super Basic If-Then-Else I_icon_minitimeThu Feb 18, 2010 7:20 pm by ThatOneDude

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendarCalendar

 

 Super Basic If-Then-Else

Go down 
AuthorMessage
miniCruzer
Member
Member
miniCruzer


Number of posts : 9
Age : 48
Where You Live : Kentucky
Hobbies & Pastimes : Scripting, Anything Computers, Outdoors, Camping
Registration date : 2007-05-05

Super Basic If-Then-Else Empty
PostSubject: Super Basic If-Then-Else   Super Basic If-Then-Else I_icon_minitimeSun May 24, 2009 4:54 pm

To understand If-Then-Else, you should already know the basics of Remotes

I will explain to you the use of If-Then-Else statements, as mIRC F1 help fails...epically...

Let's establish a code! This one will be used to set the channel topic! It uses security...very minimal though.

Code:

on 1:TEXT:!topic *:#channel: {
if ($me != isop) msg $chan I must be an op to set $chan topic!!!
if ($nick != isop) msg $chan You must be an op to set $chan topic!!!
if ($me == isop) { if ($nick == isop) msg cs topic $chan $1- } }
msg $chan Topic has been set to $1-
}
Since you already know basic remotes, I'll go over what we used to make this !topic.

You already know that the user must type !topic to set the topic

The :!topic *: means to listen for something after the user types !topic

Now we dive into the meat of Remotes!!!!
Code:
 if ($me != isop) msg $chan I must be an op to set $chan topic!!!

if - DUH self explanatory

($me - starts the if statement. Must be enclosed in ( )
!= - IS NOT EQUAL TO
isop - Is an Op
---This first statement checks to see if the bot is set as an op. If not, it notifies you.

($nick - The nick who wants to set the topic
---If the person trying to set the topic is not an op, it won't set the topic and notifies you.

($me == isop) - Checks to see if the bot is an op
IF the bot is an op, then it checks to see if the user is an op
($nick == isop) - Is user an op? If yes...
msg cs topic $chan $1- - Messages ChanServ, sets Topic, to $chan (the channel it's on), and $1- (the topic) Be SURE to include the - after $1, otherwise it just includes the first word.

This is what mIRC F1 says about the operators (which is the isop)
Quote :

isalnum text contains only letters and numbers
isalpha text contains only letters
islower text contains only lower case letters
isupper text contains only upper case letters

ison nickname v1 is on channel v2
isop nickname v1 is an op on channel v2
ishop nickname v1 is a halfop on channel v2
isvoice nickname v1 has a voice on channel v2
isreg nickname v1 is a normal nick on channel v2
ischan if v1 is a channel which you are on.
isban if v1 is a banned address in the internal ban liston channel v2

isaop if v1 is a user in your auto-op list for channel v2 (v2
optional)
isavoice if v1 is a user in your auto-voice list for channel v2
(v2 optional)
isignore if v1 is a user in your ignore list with the ignore
switch v2 (v2 optional)
isprotect if v1 is a user in your protect list for channel v2
(v2 optional)
isnotify if v1 is a user in your notify list.
Back to top Go down
http://minicruzer911.co.cc/
 
Super Basic If-Then-Else
Back to top 
Page 1 of 1
 Similar topics
-
» Super Basic Remotes
» Mr_Circus is graduating army basic training today

Permissions in this forum:You cannot reply to topics in this forum
UNITED Radio Forum :: mIRC Help Section-
Jump to: