mIRC Home    About    Download    Register    News    Help

Print Thread
Help with 2 commands #231912 09/05/11 10:21 PM
Joined: May 2011
Posts: 24
K
Kreuz123123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
Posts: 24
Hello smile only yesterday i started using the script editor and everywhere i searched i found only the basic commands so i have learned about TEXT and messages now im planning to do 1 is
.call <text> that returns 2 lines, in the first line it calls all the users in the channel (eg. User1, User2, User3, User4)
and on the second line it writes the Text in bold red text

and the second command is .notice
an admin can do .notice set <text> and when people enter the channel and do .notice they see the text that the admin has set

can i please get help with those 2 commands? after seeing how this works i can pick up on things and learn a bit more.

Re: Help with 2 commands [Re: Kreuz123123] #231915 10/05/11 12:47 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Regarding your first command, you're going to have to clarify what you mean by "it calls all the users in the channel"

Aside from that, both of your requests are simple ON TEXT events, and there are many ways of doing this. I'll give you how I would do it.
Code:
on *:text:*:#:  call_notice $1-
on *:action:*:#:  call_notice $1-
on *:notice:*:#:  call_notice $1-
alias -l call_notice {
  tokenize 32 $strip($1-)
  if ($1 == .call) {
    if !$2 {      .notice $nick Usage: .call <text>    }
    else {      .describe 4 $$2-    }
  }
  elseif $1 == .notice {
    if !$2 && $($+(%,notice,$network,$chan),2) {      .notice $nick $v2    }
    elseif ($2 == set) {
      if ($nick isop $chan) {
        if $$3- {          set $+(%,notice,$network,$chan) $$3-        }
        else .notice $nick Usage: .notice set <notice>
      }
      else .notice $nick Sorry, but you have to be an Op on $chan to use this
    }
  }
}

I have included a few extra things in here, but most of what is in the code is easily found in the mIRC help file. The exceptions are the usage of $+(%,notice,$network,$chan) and $($+(%,notice,$network,$chan),2)

The first of these sets a variable which, in this case, is network and channel specific. The second returns the value of that variable. The fact that these are network and channel specific means that it can be used on multiple channels and/or networks simultaneously and the settings/messages are kept separate from that of another channel and/or network.

Re: Help with 2 commands [Re: RusselB] #231924 10/05/11 10:37 AM
Joined: May 2011
Posts: 24
K
Kreuz123123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
Posts: 24
i put it in the script Editor but it doesnt work in Mibbit i think its the Alias

edit: tried to edit it a little and remove the alias but still no response

Last edited by Kreuz123123; 10/05/11 12:54 PM.
Re: Help with 2 commands [Re: Kreuz123123] #231926 10/05/11 04:44 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Is this in its own file? Does your server have font code at the beginning of incoming text?

Re: Help with 2 commands [Re: DJ_Sol] #231928 10/05/11 05:13 PM
Joined: May 2011
Posts: 24
K
Kreuz123123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
Posts: 24
no only if u use color text :P then even simple commands doesnt work

Re: Help with 2 commands [Re: Kreuz123123] #231951 11/05/11 09:28 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I've seen so many codes that work just fine on hundreds of networks, but not on Mibbit, that I suspect that Mibbit isn't following standard IRC protocols.

Re: Help with 2 commands [Re: RusselB] #231952 11/05/11 09:33 AM
Joined: May 2011
Posts: 24
K
Kreuz123123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
Posts: 24
ill try to find another IRC client to test just dont know any and mibbit was comfortable

Re: Help with 2 commands [Re: Kreuz123123] #231961 11/05/11 03:19 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Another IRC client wouldn't be able to handle that script as it is written, as the scripting language used is for mIRC only.

Re: Help with 2 commands [Re: Kreuz123123] #231962 11/05/11 03:36 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Originally Posted By: Kreuz123123
no only if u use color text :P then even simple commands doesnt work


Code:
on *:text:*:#{
tokenize 32 $strip($1-)
;or
if ($strip($1) = .hello)

}


The $strip command strips normal, mirc style font styles. If the server uses its own font style format, you would strip it when you tokenize.

Re: Help with 2 commands [Re: DJ_Sol] #231967 11/05/11 10:20 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I used the tokenize command in the script I wrote, and yet the OP states that it's not working on Mibbit, thus making me think that Mibbit might (somehow) be putting something on to the text that isn't being stripped off, thus making the script not work.

Re: Help with 2 commands [Re: RusselB] #231968 11/05/11 10:39 PM
Joined: May 2011
Posts: 24
K
Kreuz123123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
Posts: 24
well is there any Web like IRCS like mibbit where strip and alias does work? i dont know any because when i first joined IRC it was from Mibbit nad yes i tried also all this Aliases and other stuff and they dont work at all there...

Re: Help with 2 commands [Re: RusselB] #231973 11/05/11 11:29 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
The only way to find out is connecting to Mibbit and seeing for yourself.