mIRC Home    About    Download    Register    News    Help

Print Thread
#128798 30/08/05 10:29 AM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
1st question
Code:
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
Code:
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...
Quote:
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.

#128799 30/08/05 11:38 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
[quote]1st question
Code:
on *:TEXT:*:#:{
  if ([color:red]$me isin $1-[/color]) {
    msg # hi!  }
} 


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#128800 30/08/05 11:41 AM
Joined: Jul 2005
Posts: 25
U
Ameglian cow
Offline
Ameglian cow
U
Joined: Jul 2005
Posts: 25
1 st Question:

Code:
on *:text:*:#:if ($me isin $strip($1-)) msg # hi!  

2 nd Question:

Code:
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.
#128801 30/08/05 12:56 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
For #2:

Code:
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
#128802 30/08/05 01:12 PM
Joined: Jul 2005
Posts: 25
U
Ameglian cow
Offline
Ameglian cow
U
Joined: Jul 2005
Posts: 25
and...
Riamus2.
$? can not be used in events. wink

#128803 30/08/05 01:29 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That is incorrect. Yes, the help file says this, but it works.

Try this simple script:

Code:
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
#128804 30/08/05 01:50 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
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.
#128805 30/08/05 01:56 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Combined
Code:
on *:chat:Please enter your nickname.:{
  if (=$nick == [color:red]=[/color]BOTNICK) {
    .msg =$nick $$?="Enter nickname" $$?*="Enter password"
  }
}

Seperated
Code:
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
#128806 30/08/05 02:10 PM
Joined: Jul 2005
Posts: 25
U
Ameglian cow
Offline
Ameglian cow
U
Joined: Jul 2005
Posts: 25
Quote:
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.

#128807 30/08/05 03:20 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
#128808 31/08/05 12:51 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
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.

#128809 31/08/05 03:13 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
#128810 31/08/05 01:52 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
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

Link Copied to Clipboard