mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
I'm learning mIrc scripting and looking at examples but the on Text event are still puzzling

What is the difference
Quote:
on *:text: and
on 1:TEXT:*


Is there other type of on text events to consider please

Joined: Dec 2014
Posts: 68
M
Babel fish
Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Okay, I am not that good but I will try and give an example of a working on text, as well as an explanation, and an additional feature --

Here is an example >:

Code:
 on 1:text:hello:#: { 
 msg $chan /me Hello $nick!

Code breakdown >: on '1' This is at what level you want it to activate at, All players have a 'level' which are assigned to them, so if someones level is 1 and the level is set to 5 - They won't be able to use the command '*' means it can be used by anyone negating the level factor.

Here is a on text say to someone else >:
Code:
 on 1:text:!splat*:#: { 
msg $chan $nick has splatted $2 with sticky goo!

Code breakdown >: The '$nick' refers to the actual user who initiated the command so if I was to type "!splat <username>" it would say I have splatted <username>. The '$2' refers to the second word typed if you wish it to be anywords AFTER(Including that word) then it would be $2- so if I typed the command the <username> typed would be the second word / name typed.

Here is an isop test command.
Code:
on *:text:!timeout*:#: {
  if ($nick isop #) {
    msg $chan /timeout $2
  }
}

Code breakdown >: "if ($nick isop #)" the "$nick" I have mentioned already so I will ignore, "isop" this tests for the if the user trying has op status on the irc, so again, If the the user is not of op status, The commands won't activate, '#' You would change to '#michaelukz' (The IRC you wish it to be for).

*Note: All these work for twitch in which I presume you are coding for.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Unless you are using /auser or /guser or maintaining the Users tab, don't use '1' as a prefix. Just use '*'.

On *:TEXT: ...


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2014
Posts: 68
M
Babel fish
Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Did my 'tutorial' help, it's my first time trying to explain it, did it make sense / you understand it?

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
To clarify:
Originally Posted By: /help Access levels

The default access level is 1 for users that are not listed in the Users list. All users can access level 1 events. The higher a user's access level is, the more events that user can access. You can change the default user level to allow unlisted users to access more commands.
If you want to get the event to be triggered no matter what the default level is, use *


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
Sorry for late reply. michaelukz thank it certainly help a lot.

Thanks also to the other replies.


Link Copied to Clipboard