mIRC Home    About    Download    Register    News    Help

Print Thread
#193513 20/01/08 12:22 PM
Joined: Jan 2008
Posts: 21
V
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2008
Posts: 21
Im bassicly new to scripting for mirc but i use this now:

Code:
;- if the text !help is
on *:text:!help*:#:{
  /msg $nick these commands are for operator ---> !op <nick> - !deop <nick> - !voice <nick> - !devoice <nick> - !kick <nick>
}
}
}


This works i get the message in pm with the line if i typ !help.

But i want multiple lines like that i get the message like this:

Code:
These commands are for Operators:

!op <nick>   - OP a nick
!deop <nick> - Deop a nick
!voice <nick> - Voice a nick
!devoice <nick> - Devoice a nick
!kick <nick> - Kick a user.


How can i do that?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You should only have one } there because you only have one { .. the number of {s and }s should always match.

To message multiple lines you just use multiple /msg commands.

Code:
on *:text:!help*:#:{
  msg $nick these commands are for operator ---> 
  msg $nick !op <nick> 
  msg $nick !deop <nick>
  msg $nick !voice <nick>
  msg $nick !devoice <nick>
  msg $nick !kick <nick>
}

Joined: Jan 2008
Posts: 21
V
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2008
Posts: 21
Oke thx that one does it.

And is it possible to have a help for op and a help for voice

Zo if a operator uses !help then he gets that message
And if a voice user uses !help he gets a other message with commands he can use.
Is this possible


Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Code:
on *:TEXT:!help*:#:{
  if ($nick isop $chan) { messages }
  elseif ($nick isvoice $chan) { other messages }
}

You can also use ishop for half-op, if it's supported, and isreg for regular users.

Last edited by 5618; 20/01/08 02:12 PM.
Joined: Jan 2008
Posts: 21
V
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2008
Posts: 21
Oke thx i thought it was something with if and elseif but couldnt find it out myself thx for your help

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Note that you can also put the help text into a text file and then /play it to the user if you want. This allows you to have more control over slowing down the messages so you don't get flooded off the server for sending too many lines at once.

If you're doing different helps for ops/voices/etc, you could even set up "topics" in the text file and then /play the specific topic. For example, you might have a file called help.txt and inside, it would look like:
Quote:

[op]
Help line 1 for ops
Help line 2 for ops
Help line 3 for ops
[voice]
Help line 1 for voiced
Help line 2 for voiced
[regular]
Help line 1 for regular
Help line 2 for regular

Then, your script might look like this:

Code:
on *:text:!help:#yourchannel: {
  if ($nick isop $chan) { play -top $nick help.txt 1000 }
  elseif ($nick isvo $chan) { play -tvoice $nick help.txt 1000 }
  else { play -tregular $nick help.txt 1000 }
}


Remember to change the channel name here to match your channel.


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2007
Posts: 228
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Code:
on *:TEXT:!help:#yourchan:{
  if ($nick isop $chan) {
    msg $nick these commands are for operator ---> 
    msg $nick !op <nick> 
    msg $nick !deop <nick>
    msg $nick !voice <nick>
    msg $nick !devoice <nick>
    msg $nick !kick <nick>
  }
  elseif ($nick isvoice $chan) {
    msg $nick !voice stuff
    msg $nick !voice stuff
    msg $nick !voice stuff
    msg $nick !voice stuff>
    msg $nick !voice stuff
    msg $nick !voice stuff
  }
}


That might be easier for you to work with and edit to your needs. However, you'll want to keep in mind that you can get flooded off fairly easily that way, and that perhaps you might want to use /play as Riamus2 suggested.

Last edited by Mpot; 21/01/08 02:23 AM.

Link Copied to Clipboard