Author Topic: Need little help  (Read 5867 times)

Yugi

  • Newbie
  • *
  • Posts: 29
Need little help
« on: June 20, 2007, 06:21:56 PM »
hi  :-D
i am trying to make a greeting script when someone say different thing in a channel like:
hi, hello, heya, hey, lo, elo, ello, hiya and so on

do i use multiple events or... not sure
i also need it to trigger only on regular users , not on ops or voices
* Yugi wonders how to do that too

i already figured the reply  :lol:
 /msg $chan hi $nick wlcome to $chan :)

any hellp is very appreciated  :wink:
* Yugi looks at Morio  :-D and Snerf  :-D
IceChat - Cool to the core!

Yugi

  • Newbie
  • *
  • Posts: 29
Re: Need little help
« Reply #1 on: June 20, 2007, 06:42:47 PM »
uh is it possible to use the same reply for all i mean can the reply be only one instance in the script
IceChat - Cool to the core!

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Need little help
« Reply #2 on: June 20, 2007, 11:08:13 PM »
Which style of scripting, thats kind of important.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Need little help
« Reply #3 on: June 21, 2007, 09:44:08 AM »
VB-scripting (as I don't understand the mIRC-style :D)

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
'Check that not op or voice
  If not (ISOP(Nickname,Channel,ServerNumber) or ISVOICE(Nickname,Channel,ServerNumber)) Then
    'Look for the word to trigger for
    If Message = LCase("hello") or Message = LCase("hi") then
     'send the reply
      SendCommand "/msg " + Channel + " thing to say to those people", ServerNumber
    End If
  End If
End Sub

you can add more words to trigger for by editing the SendCommand Line
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Yugi

  • Newbie
  • *
  • Posts: 29
Re: Need little help
« Reply #4 on: June 21, 2007, 04:15:53 PM »
Thanks Morio
i was hoping for the new mirc style scripting  :-D
because its much easier to learn and needs further :-D testing
Snerf would you do it for me in the mirc style scripting, please?
« Last Edit: June 21, 2007, 04:17:49 PM by Yugi »
IceChat - Cool to the core!

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Need little help
« Reply #5 on: June 21, 2007, 06:31:22 PM »
I will have to play around with some things, because what I thought would work, is not working.
The IceChat God

Yugi

  • Newbie
  • *
  • Posts: 29
Re: Need little help
« Reply #6 on: June 22, 2007, 03:49:42 PM »
Ok, take your time  :wink:
i am not in a hurry, just don't forget me  :-D
i am glad i could help a little bit in the testing again :-D
IceChat - Cool to the core!

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Need little help
« Reply #7 on: June 22, 2007, 03:51:03 PM »
Ok, I got a script working, but you will need the latst 7.51 update, because, yes, another bug was found in mirc scripting. And again, it had to do with parsing identifiers. I also need to check out with IF statements and using &&.
So get the latest build, and use this script.

Code: [Select]
on *:TEXT:hi*,*ello*,hey*:#:{
if ( $nick($chan,$nick).op == $false )
if ( $nick($chan,$nick).voice == $false )
{
/msg $chan Hello to you $nick
}
}
}
The IceChat God

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Need little help
« Reply #8 on: June 23, 2007, 10:52:20 AM »
Ok, this is the better way to do it, and works with the latest build.

Code: [Select]
on *:TEXT:hi*,*ello*,hey*:#:{
if (( $nick($chan,$nick).op == $false ) && ( $nick($chan,$nick).voice == $false ))
{
/msg $chan Hello to you $nick
}
}
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Need little help
« Reply #9 on: June 23, 2007, 12:54:15 PM »
The
Found a bug in my script

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
'Check that not op or voice
  If not (ISOP(Nickname,Channel,ServerNumber) or ISVOICE(Nickname,Channel,ServerNumber)) Then
    'Look for the word to trigger for
    If LCase(Message) = "hello" or LCase(Message) = "hi" then
     'send the reply
      SendCommand "/msg " + Channel + " thing to say to those people", ServerNumber
    End If
  End If
End Sub

And ofcourse you add more words to trigger for by editing the line that starts with If LCase(Message) not the SendCommand line ^^
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein