mIRC Home    About    Download    Register    News    Help

Print Thread
Automated Text #167847 31/12/06 05:28 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Hi there everyone.

I have made a few text responses for my bot to respond to. When i load them as individual text documnets they work fine, but when i try and group them into 1 file they do not work

Below is how i have grouped them when they don't work:

Code:
on 3:text:*Be Right Back*:#: {
  if ($nick isop $chan) { bt $nick 3Please ensure that if you are going Away From Keyboard to downgrade yourself from Op Status and Op up another Op.  If you already have your status as a none Op there is nothing to do. :) }
}
}
on 1:text:*hi room*:#: {
bt $chan 3 Welcome to $chan $1 .  Please vist this post to View Welcome Message.  4,1http://www.simonsforums.org/forum/viewtopic.php?p=432#432  3This will explain Site policy. }
}
}
on 1:text:*register nick*:#: {
bt $chan 3 To Register you nick first you choose a nick by typing /nick Worzel then you register that nick by typing /nickserv register *a password of your choice* *your email* 
bt $chan 3 But you must not enter the * symbols, for example you would type /nickserv register 123456 worzel@gummidge.com
bt $chan 3 Then to identify yourself you type /nickserv identify 123456
bt $chan 3 123456 being YOUR password. }
}
}
on 1:text:*welcome to the room*:#: {
bt $chan 3Please register on the $chan 's web site for latest news and bloggs and forums and help and advice. The address is 4http://www.simonsforums.org 3It is free to register, all we ask is you use it regular and spread the word to allow the room to grow from strength to strength. :)  Thank You. }
}
}


And below is when they are singular and work:

Code:
on 3:text:*Be Right Back*:#: {
  if ($nick isop $chan) { bt $nick 3Please ensure that if you are going Away From Keyboard to downgrade yourself from Op Status and Op up another Op.  If you already have your status as a none Op there is nothing to do. :) }
}
}


If anyone could help me resolve this issue i would be greatful.


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Automated Text [Re: BritishGent] #167848 31/12/06 05:46 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
It could be a conflict. With on text events, if you have three events and the first one catches something, mIRC stops looking for more events that will match in that document. example:

Code:
on *:TEXT:*hello*:#: { ... }
on *:TEXT:*be right back*:#: { ... }
on *:TEXT:*goodbye*:#: { ... }


Now, if a user says "hello everyone, I'll be right back" the first event will trigger, but the second will not. Why? Because mIRC has found a match already and does not continue further. To solve this, try using if statements:

Code:
on 1:TEXT:*:#: {
  if (*register nick* iswm $1-) {
    bt $chan 3 To Register you nick first you choose a nick by typing /nick Worzel then you register that nick by typing /nickserv register *a password of your choice* *your email* 
    bt $chan 3 But you must not enter the * symbols, for example you would type /nickserv register 123456 worzel@gummidge.com
    bt $chan 3 Then to identify yourself you type /nickserv identify 123456
    bt $chan 3 123456 being YOUR password.
  }
  if (*welcome to the room* iswm $1-) {
    bt $chan 3Please register on the $chan 's web site for latest news and bloggs and forums and help and advice. The address is 4http://www.simonsforums.org 3It is free to register, all we ask is you use it regular and spread the word to allow the room to grow from strength to strength. :)  Thank You.
  }
}

on 3:TEXT:*:#: {
  if ([color=red]*be right back*[/color] iswm $1-) {
    if ($nick isop $chan) { bt $nick 3Please ensure that if you are going Away From Keyboard to downgrade yourself from Op Status and Op up another Op.  If you already have your status as a none Op there is nothing to do. :) }
  }
}


Hope that assists you in some way.


-KingTomato
Re: Automated Text [Re: KingTomato] #167849 31/12/06 06:06 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Sorry you have totally confused me...

They all work individually in seperate .mrc files, but i want to group them in 1 .mrc file, but when i do that nonoe of them work.


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Automated Text [Re: BritishGent] #167891 01/01/07 03:54 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Put all the codes into the same file, and then click the [{}] button in the top right of the code window. You will see that your brackets don't match up properly. Correct the brackets, and your code should work.

-genius_at_work

Re: Automated Text [Re: genius_at_work] #167920 01/01/07 06:23 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Originally Posted By: genius_at_work
Put all the codes into the same file, and then click the [{}] button in the top right of the code window. You will see that your brackets don't match up properly. Correct the brackets, and your code should work.

-genius_at_work


This is how i have my code now:

Code:
on 1:text:*Be Right Back*:#: {
  if ($nick isop $chan) { bt $nick 3Please ensure that if you are going Away From Keyboard to downgrade yourself from Op Status and Op up another Op.  If you already have your status as a none Op there is nothing to do. :)
  }
on 1:text:*hi room*:#: {
  bt $chan 3 Welcome to $chan $nick .  Please vist this post to View Welcome Message.  4,1http://www.simonsforums.org/forum/viewtopic.php?p=432#432  3This will explain Site policy.
  }
on 1:text:*register nick*:#: {
  bt $chan 3 To Register you nick first you choose a nick by typing /nick Worzel then you register that nick by typing /nickserv register *a password of your choice* *your email*
  bt $chan 3 But you must not enter the * symbols, for example you would type /nickserv register 123456 worzel@gummidge.com
  bt $chan 3 If you already have a nick registered all you need type is /nickserv register *a password of your choice*
  bt $chan 3 But you must not enter the * symbols, for example you would type /nickserv register 123456
  bt $chan 3 Then to identify yourself you type /nickserv identify 123456
  bt $chan 3 123456 being YOUR password.
  }
on 1:text:*room rules*:#: {
  bt $chan 3Please refer to the room rules @ 3( 4,1http://simonsforums.org/forum/viewtopic.php?t=7 3)  Failure to Observe these Rules will result in a no warning BAN!!  Sorry for this Stance but it is for the pleasurable use of this service for it's regulars.   Thank you.
  }
on 1:text:*welcome to the room*:#: {
  bt $chan 3Please register on the $chan 's web site for latest news and bloggs and forums and help and advice. The address is 4http://www.simonsforums.org 3It is free to register, all we ask is you use it regular and spread the word to allow the room to grow from strength to strength. :)  Thank You.
  }
on 1:text:*please do not pvt me*:#: {
  bt $chan 3Please DO NOT pvt Users of $chan 's unless you have prior consent from that user.  Thank You.
  }
on 3:action:*see website for details*:#: {
  inc %websitedetails
  if (%websitedetails == 10) {
  bt $chan 3The Website is now broadcasting live media.  If you are a member of #Simons-Forums then please go to4 http://www.simonsforums.org/forum/viewtopic.php?p=709#7093 and view how to listen or Visit the home page if Registered.
  unset %websitedetails
  }
on *:Text:*funcommands:#: {
  if $1 == %c $+ funcommands {
  msg $chan !beer, !pepsi, !pizza, !whiskey, !guiness, !coke, !coffee, !wank, !iq, !owner, !tickle, !smoke, !playboy, !lager
  msg $chan !vodka, !baileys, !tea, !shandy, !choccy, !olive, !smack, !hump, !lamer, !spank, !phones, !closet, !settlers
  msg $chan !biccies, !looks, !chocomilk, !stella, !beefburger, !salute, !kebab, !galaxy, !slap, !donuts, !geisha, !gin, !soda
  }
}


and when i press the {} symbol i get the message:

" There seems to be a bracket mis-match somewhere around line 24 "

Which is:

Code:
{


Which is at the end of please do not pvt me.

Any help would be appreciated.

Thanks in advance.


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Automated Text [Re: BritishGent] #167923 01/01/07 06:45 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It looks to me like you're missing a bracket at the end of EVERY event. If your on TEXT event has 2 {'s in it, then it better have 2 }'s in it as well.

If you put your script into mIRC's script editor, switch tabs to something else, then switch back, you'll notice that each on TEXT event does not start at the beginning of the line. This tells you that you're missing a bracket. ALL events should start at the beginning of the line and ALL items inside those events should be spaced at least 2 spaces from the beginning of the line (they shouldn't be at the beginning of the line). When you tab to something else (aliases, for example), then back to your script, it will put the spacing in based on your {}'s. You can then find any errors you have.

After switching tabs like that, if you see something like this (notice the second on TEXT event), you know you're missing a } before that second event.
Code:
on *:text:hello:#: {
  if (%test == $true) {
    do this
  }
  on *:text:goodbye:#: {


Or, if you see something like this:
Code:
on *:text:hello:#: {
  if (%test == $true) {
  do this }
}
else do this
}
on *:text:goodbye:#: {


Because the else is not spaced in from the edge, you know that you have too many }'s (or not enough {'s ).


Invision Support
#Invision on irc.irchighway.net
Re: Automated Text [Re: BritishGent] #167925 01/01/07 06:49 PM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Code:
on 1:text:*Be Right Back*:#: {
  if ($nick isop $chan) { bt $nick 3Please ensure that if you are going Away From Keyboard to downgrade yourself from Op Status and Op up another Op.  If you already have your status as a none Op there is nothing to do. :)
  }
}
on 1:text:*hi room*:#: {
  bt $chan 3 Welcome to $chan $nick .  Please vist this post to View Welcome Message.  4,1http://www.simonsforums.org/forum/viewtopic.php?p=432#432  3This will explain Site policy.
}
on 1:text:*register nick*:#: {
  bt $chan 3 To Register you nick first you choose a nick by typing /nick Worzel then you register that nick by typing /nickserv register *a password of your choice* *your email*
  bt $chan 3 But you must not enter the * symbols, for example you would type /nickserv register 123456 worzel@gummidge.com
  bt $chan 3 If you already have a nick registered all you need type is /nickserv register *a password of your choice*
  bt $chan 3 But you must not enter the * symbols, for example you would type /nickserv register 123456
  bt $chan 3 Then to identify yourself you type /nickserv identify 123456
  bt $chan 3 123456 being YOUR password.
}
on 1:text:*room rules*:#: {
  bt $chan 3Please refer to the room rules @ 3( 4,1http://simonsforums.org/forum/viewtopic.php?t=7 3)  Failure to Observe these Rules will result in a no warning BAN!!  Sorry for this Stance but it is for the pleasurable use of this service for it's regulars.   Thank you.
}
on 1:text:*welcome to the room*:#: {
  bt $chan 3Please register on the $chan 's web site for latest news and bloggs and forums and help and advice. The address is 4http://www.simonsforums.org 3It is free to register, all we ask is you use it regular and spread the word to allow the room to grow from strength to strength. :)  Thank You.
}
on 1:text:*please do not pvt me*:#: {
  bt $chan 3Please DO NOT pvt Users of $chan 's unless you have prior consent from that user.  Thank You.
}
on 3:action:*see website for details*:#: {
  inc %websitedetails
  if (%websitedetails == 10) {
    bt $chan 3The Website is now broadcasting live media.  If you are a member of #Simons-Forums then please go to4 http://www.simonsforums.org/forum/viewtopic.php?p=709#7093 and view how to listen or Visit the home page if Registered.
    unset %websitedetails
  }
}
on *:Text:*funcommands:#: {
  if $1 == %c $+ funcommands {
    msg $chan !beer, !pepsi, !pizza, !whiskey, !guiness, !coke, !coffee, !wank, !iq, !owner, !tickle, !smoke, !playboy, !lager
    msg $chan !vodka, !baileys, !tea, !shandy, !choccy, !olive, !smack, !hump, !lamer, !spank, !phones, !closet, !settlers
    msg $chan !biccies, !looks, !chocomilk, !stella, !beefburger, !salute, !kebab, !galaxy, !slap, !donuts, !geisha, !gin, !soda
  }
}

Re: Automated Text [Re: bwr30060] #167932 01/01/07 07:12 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Thank you. smile


Never ASSUME!!!

As it often makes and ASS out of U and ME!!