mIRC Homepage
Posted By: Kreuz123123 Help with 2 commands - 09/05/11 10:21 PM
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.
Posted By: RusselB Re: Help with 2 commands - 10/05/11 12:47 AM
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.
Posted By: Kreuz123123 Re: Help with 2 commands - 10/05/11 10:37 AM
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
Posted By: DJ_Sol Re: Help with 2 commands - 10/05/11 04:44 PM
Is this in its own file? Does your server have font code at the beginning of incoming text?
Posted By: Kreuz123123 Re: Help with 2 commands - 10/05/11 05:13 PM
no only if u use color text :P then even simple commands doesnt work
Posted By: RusselB Re: Help with 2 commands - 11/05/11 09:28 AM
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.
Posted By: Kreuz123123 Re: Help with 2 commands - 11/05/11 09:33 AM
ill try to find another IRC client to test just dont know any and mibbit was comfortable
Posted By: RusselB Re: Help with 2 commands - 11/05/11 03:19 PM
Another IRC client wouldn't be able to handle that script as it is written, as the scripting language used is for mIRC only.
Posted By: DJ_Sol Re: Help with 2 commands - 11/05/11 03:36 PM
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.
Posted By: RusselB Re: Help with 2 commands - 11/05/11 10:20 PM
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.
Posted By: Kreuz123123 Re: Help with 2 commands - 11/05/11 10:39 PM
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...
Posted By: Tomao Re: Help with 2 commands - 11/05/11 11:29 PM
The only way to find out is connecting to Mibbit and seeing for yourself.
© mIRC Discussion Forums