|
Joined: Jun 2004
Posts: 124
Vogon poet
|
OP
Vogon poet
Joined: Jun 2004
Posts: 124 |
1st question on *:TEXT:*:#:{
if ($1- == $me) {
msg # hi! }
} how can i make this script detect my nick anywhere in the msg and detect even the msg is colored or in attributes? 2nd question on *:chat:Please enter your nickname.*:{
if $nick = nick {
.msg =$nick $$input(Enter Username:, eq) $$input(Enter Password:,2)
}
} how can i make my 2nd script detect the "Please enter your nickname." in a dcc chat and after the script detect the phrase it will popup some inputbox and it will ask for username and password and the password must be masked... the 2nd script is for dcc chat... Session Ident: ([bot nick] ([my nick]) (DCCChat@ipaddress) ([bot nick]): [91] Chat established ([bot nick]): ([bot nick]): ([bot nick]): Welcome (Eggdrop v1.6.17) ([bot nick]): ([bot nick]): Please enter your nickname.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
[quote]1st question on *:TEXT:*:#:{
if ([color:red]$me isin $1-[/color]) {
msg # hi! }
}
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Jul 2005
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Jul 2005
Posts: 25 |
1 st Question: on *:text:*:#:if ($me isin $strip($1-)) msg # hi! 2 nd Question: on *:chat:Please enter your nickname.*:timer 1 1 /id $nick
alias -l id {
if ($1 == nick) .msg $1 $$input(Enter Username:, eq) $$input(Enter Password:,2)
} $input don't use in events.
Last edited by UOnur; 30/08/05 11:42 AM.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
For #2:
on *:text:Please enter your nickname:=:{
if (=$nick == botnick) {
.msg =$nick $$?="Enter Username" $$?*="Enter password"
}
}
= in your on text line makes it trigger only in chat. $$?="" pops your box up if you don't enter anything (or hit cancel), it won't send anything, so you won't get an error. $$?*="" is the same, but hides the password as you enter it.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2005
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Jul 2005
Posts: 25 |
and... Riamus2. $? can not be used in events.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
That is incorrect. Yes, the help file says this, but it works. Try this simple script:
on *:input:*: {
echo -a $$?="Echo this"
}
You can test it with dialogs and with text and whatever else.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Yes, you can use it in the on input event, but not in an on text event. It should say something like:
* $?: cannot use in an event
Gone.
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
Combined
on *:chat:Please enter your nickname.:{
if (=$nick == [color:red]=[/color]BOTNICK) {
.msg =$nick $$?="Enter nickname" $$?*="Enter password"
}
}
Seperated
on *:chat:Please enter your nickname.:{
if (=$nick == [color:red]=[/color]BOTNICK) {
.msg =$nick $$?="Enter nickname"
}
}
on *:chat:Enter your password.:{
if (=$nick == [color:red]=[/color]BOTNICK) {
.msg =$nick $$?*="Enter password"
}
}
Notes: $$? can infact be used in some events, such as on chat, dispite what the help file may say (but not on text). However it is generally not good practice as there is no timeout. Try it for yourself, it will infact work. = can not be used in the location field of an on text event. The = is required in the if statement becuase =$nick will return the nickname prefixed with a =. I provided code for both seperated and combined, as i believe eggdrop asks for nickname and password seperately, or at least my bots are set to behave in that manner.
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Jul 2005
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Jul 2005
Posts: 25 |
Yes, you can use it in the on input event, but not in an on text event. It should say something like:
* $?: cannot use in an event I agree.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Hm... I suppose I should check and see which events allow it and which don't, because there are definitely some that do (not just on input). And, if on text is the only one or one of only a couple that don't allow it, I think those should be made to allow it.
I did forget about on chat.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
I assume there was good reason it wasnt allowed in some events, either its becuase it causes the system to become unstable, or more liekly becuase placing a script pausing input request in an event like that well cause you never to catch up with 100's of paused events occuring which leads back to reason one, if its done on say ON *:TEXT:*:* and eventually mirc well fall over with some type of buffer overflow or stack failure.
The solution is as the help file says, use a timer to trigger the input after the event has ended.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Yeah, I understand why it wouldn't be in the on text event and some other events. I'm just wondering exactly which events it works with and which it don't.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
My guess is that it only works with events that do not essentially pause the script engine. I am not really sure how it is coded to treat some of the events that it does infact work with, but if you think about it on input it not an event that is triggered without interaction where are on text is, as for the on chat is it possible that due to the direct connection the events inside this are processed in a seperate thread. Shrug just blind guesses really.
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
|