mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Ok, i need a little help with this one please

I have a dialog "docked" to the side of my screen
in it is an "edit box" id number 42

Code:
   
  edit "", [color:green]42[/color], 4 326 80 10, [color:red]return[/color] 



The above code is part of my dialog, and looking at the help file, says
i need the return value added to the end so that i can use the return key
after i have typed in some words.

I also have the following code, a little further down in my code

Code:
on 1:dialog:chanset:edit:[color:green]42[/color]: {
  msg MyBot <message whatever text i type in here>
}


Basicly what i want to do, is using the id number 42 enter text in the edit box
to PM MyBot with a text trigger

Or in other words, i type "TEST" in the edit box, and press the return key to PM MyBot with the text trigger
"TEST" or any other word for that matter, for example "hello" "goodbye" and this gets PM'd to MyBot.

Does anybody understand what i mean ?? frown

i just need help with getting return to work in an edit box with my choice of text
Have read and reread the mIRC help file esp on edit boxes and /did and dialogs confused

Thanks
ShadowDemon
mIRC V6.16


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
You need to capture enter being pressed, which you can do by having an invisible button with the 'default' property enabled. After that you can use an sclick event to detect enter presses, the ID will of course be the ID of the button since if it's the default control then pressing enter will act as a click on it

Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Hmm,

here is my new sorta fixed code
as i`m not sure if this works or not, having never dealt with edit boxes before and
getting the return key to work with them.


Code:
  edit "", 42, 4 326 80 10, return
  button "", 43, 6 327 80 10, hide default


...........REST OF CODE...........

Code:
        
on 1:dialog:chanset:[color:red]sclick[/color]:43: {
  msg MyBot <message whatever text i type in here>
}


I changed the ID of 42 to 43 and added an SCLICK event

Please let me know if this is right or wrong, and correct me if you can

I also now have the problem with the msg MyBot part, how can i MSG MyBot with whatever text i type into
the edit box, all i get now is

-
* /msg: insufficient parameters (line 683, blascript.mrc)
-


Line 683 is the Msg MyBot part of my script confused

Thanks for the help

ShadowDemon
mIRC V6.16


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Code:
msg MyBot $$did(42)


$did(42) returns the text in your editbox, the double $ makes the process halt if there is no text, to avoid that insufficient parameters error

Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Thanks Sigh, thats a great help smile

It all works now, it echo's anything i type into my edit box

Just one more thing if you can help me, is there a way to clear
what i type after i hit return key ??

ShadowDemon
mIRC V6.16


Never argue with an idiot...they'll drag you down to their level and beat you up with experience

Link Copied to Clipboard