Author Topic: *s  (Read 9563 times)

Jacob

  • Newbie
  • *
  • Posts: 45
*s
« on: March 30, 2008, 08:20:55 AM »
So in icechat 7, you can say

Code: [Select]
on *:TEXT:!test *:......
So that will make it so when someone says !test then anything it will trigger it. How do I do that in IceChat 5 with the ONTEXT command?

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: *s
« Reply #1 on: March 30, 2008, 08:30:35 AM »
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,5) = "!test" then
.
.
.
End Sub
"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

Jacob

  • Newbie
  • *
  • Posts: 45
Re: *s
« Reply #2 on: March 30, 2008, 08:32:20 AM »
So what is ,5?

Jacob

  • Newbie
  • *
  • Posts: 45
Re: *s
« Reply #3 on: March 30, 2008, 08:37:48 AM »
It dosent work. !Test asdfghjkl; does not trigger it

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: *s
« Reply #4 on: March 30, 2008, 10:15:48 AM »
that's because you used a capital 'T' to make it not case sensitive change the line to this:

Code: [Select]
If Left(LCase(Message),5) = "!test" then
The ',5' means that the code checks for the first 5 characters
"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

Jacob

  • Newbie
  • *
  • Posts: 45
Re: *s
« Reply #5 on: March 30, 2008, 11:52:06 AM »
OK, heres all of the code:

Code: [Select]
Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
Name = GetIniFile("Users.ini","Users",Nickname,"DeafultValue")
if Name = "Allowed" then
If Left(Message,8) = "!AddUser" then
SendCommand "//addop " & Nickname & " " & Message
else
SendCommand "//msg " & Nickname & "You are not authed or have entered an invalid command"
end if
end if
End Sub

Heres the INI file:

Code: [Select]
[Users]
Jacob=Allowed
Robert=Allowed

Doing: "/notice [ChannelHelper] !AddUser Test" Does nothing

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: *s
« Reply #6 on: March 30, 2008, 12:14:22 PM »
do you have an alias '/addop' ?
"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

Jacob

  • Newbie
  • *
  • Posts: 45
Re: *s
« Reply #7 on: March 30, 2008, 12:32:21 PM »
/addop {
/! Test $3-
//notice $1 Done.
}

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: *s
« Reply #8 on: March 30, 2008, 01:00:42 PM »
and what does your 'Test' sub look like?
"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

Jacob

  • Newbie
  • *
  • Posts: 45
Re: *s
« Reply #9 on: March 30, 2008, 01:13:29 PM »
Sub Test(hi)
WriteIniFile "Users.ini","Users",hi,"Allowed"
End Sub

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: *s
« Reply #10 on: March 30, 2008, 03:28:44 PM »
Your addop alias looks wrong, because $3- is checking for the 3rd word, when you are only passing 2 (NickName and Message).
Should be $2-, for the message.
The IceChat God

Jacob

  • Newbie
  • *
  • Posts: 45
Re: *s
« Reply #11 on: March 30, 2008, 04:34:33 PM »
1) It dosent trigger it
2) The message is !AddUser <user>

Jacob

  • Newbie
  • *
  • Posts: 45
Re: *s
« Reply #12 on: March 30, 2008, 05:01:26 PM »
So it has the nickname too