Author Topic: !status  (Read 15441 times)

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: !status
« Reply #15 on: March 29, 2008, 04:04:15 PM »
Is The Script laid Out Correctly, What Did I Do Wrong?

Also, What Line Can I Put In My Topic Script To Make It Change The First Part Of The Script Only?
~ Sam
~ Visit my website at http://www.TheCellist42.com

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: !status
« Reply #16 on: March 30, 2008, 12:57:23 AM »
Here IS The Script, Its Probably Wrong:

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,8) = "!status " and Len(Message) > 8 then
If ISOP(Nickname,Channel,ServerNumber)=True then
NewTopic = Mid(Message,9)
CurrentTopic = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3)
TopicMiddle = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
SendCommand "/topic " & Channel & " " TopicLeft & " || " TopicMiddle " || " & TopicRight,ServerNumber
End If
End If
End Sub

And This Is The Error I Get:
[02:56] -- Script Engine Error:1025:Expected end of statement: Line #9 --SendCommand "/topic " & Channel & " " TopicLeft & " || " TopicMiddle " || " & TopicRight,ServerNumber

What Did I Mess Up?
~ Sam
~ Visit my website at http://www.TheCellist42.com

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: !status
« Reply #17 on: March 30, 2008, 01:06:43 AM »
Remember; for every ( there is a ). :D the problem was on lines 5 and 6. Heres the fix:


Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,8) = "!status " and Len(Message) > 8 then
If ISOP(Nickname,Channel,ServerNumber)=True then
NewTopic = Mid(Message,9)
CurrentTopic = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3))
TopicMiddle = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2))
SendCommand "/topic " & Channel & " " TopicLeft & " || " TopicMiddle " || " & TopicRight,ServerNumber
End If
End If
End Sub
This message brought to you by the Wonderful Wizard of Oz.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: !status
« Reply #18 on: March 30, 2008, 02:00:29 AM »
TheCellist42: You can't just leave out lines from the code. First of all, it won't parse the topic properly, and second, you haven't set any value for the TopicRight variable, but you are still using it.

Code: [Select]
TopicLeft = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
CurrentTopic = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3)
TopicMiddle = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
TopicRight = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3)

You need all of those lines

and also you should have just copied the sendcommand line I pasted. The 'Expected end of statement' means that there's a '&' missing from your code.

Code: [Select]
SendCommand "/topic " & Channel & " " & TopicLeft & " || " & TopicMiddle & " || " & TopicRight,ServerNumber
"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: !status
« Reply #19 on: March 30, 2008, 11:20:56 AM »
Still Nothing, I Did Everything Morio Suggested, I Tried DarkStar's Script, And Nothing Worked  :?
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: !status
« Reply #20 on: March 30, 2008, 11:42:56 AM »
just a small typo in this line:
Code: [Select]
CurrentTopic = GetIdentifier("$chan(" & Channel & ").topic", ServerNumber)This time I tested it myself, and it works
"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: !status
« Reply #21 on: March 30, 2008, 11:50:42 AM »
Well, I Replaced The Old Line With The New One And I Got No Errors, But It Didn't Change The Topic To What I Wanted

ex. Our topic is: Linksys Routers || Sam Is Sleeping || my website here

I Type "!Status Sam Is Here" and nothing happens, where as I would like for the bot to change the whole topic too...

Our topic is: Linksys Routers || Sam Is Here || my website here

Any Ideas What Has Gone Wrong?

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,8) = "!status " and Len(Message) > 8 then
If ISOP(Nickname,Channel,ServerNumber)=True then
NewTopic = Mid(Message,9)
TopicLeft = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
CurrentTopic = GetIdentifier("$chan(" & Channel & ").topic", ServerNumber)
TopicMiddle = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
TopicRight = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3)
SendCommand "/topic " & Channel & " " & TopicLeft & " || " & TopicMiddle & " || " & TopicRight,ServerNumber
End If
End If
End Sub
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: !status
« Reply #22 on: March 30, 2008, 11:56:53 AM »
the four lines I posted only separate the different parts of the topic, they only contain the information about the current topic. On your SendCommand line, replace TopicMiddle with NewTopic
"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: !status
« Reply #23 on: March 30, 2008, 12:30:35 PM »
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,8) = "!status " and Len(Message) > 8 then
If ISOP(Nickname,Channel,ServerNumber)=True then
NewTopic = Mid(Message,9)
TopicLeft = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
CurrentTopic = GetIdentifier("$chan(" & Channel & ").topic", ServerNumber)
TopicMiddle = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
TopicRight = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3)
SendCommand "/topic " & Channel & " " & TopicLeft & " || " & "NewTopic" & " || " & TopicRight,ServerNumber
End If
End If
End Sub


I Don't Know If This Is Correct Or Incorrect But It Isn't Working  :cry:

Also, I Don't Know If It Was Correct  To Put Quotations Around NewTopic, But Without Them I Got An Invalid Procedure Call Error
~ Sam
~ Visit my website at http://www.TheCellist42.com

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: !status
« Reply #24 on: March 30, 2008, 12:33:33 PM »
Never Mind I Got Invalid Procedure Call Anyway, I Was Reading The Error From The wrong Line
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: !status
« Reply #25 on: March 30, 2008, 12:38:40 PM »
Do you even read what I post.

YOU CAN'T LEAVE OUT *ANY* OF THE LINES I POSTED.

Code: [Select]
CurrentTopic = GetIdentifier("$chan(" & Channel & ").topic", ServerNumber)

TopicLeft = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
CurrentTopic = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3)
TopicMiddle = Left(CurrentTopic,InStr(CurrentTopic,"||") - 2)
TopicRight = Mid(CurrentTopic,InStr(CurrentTopic,"||") +3)

"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: !status
« Reply #26 on: March 30, 2008, 12:50:33 PM »
Yes I Read What You Posted, I Just Confused It With Something Else And Replaced The CurrentTopic Line With The New One, Sorry, It Works Now.
~ Sam
~ Visit my website at http://www.TheCellist42.com