Skip to content
MSN

Smilley in dialogs Edit Box ?

A TG007 community discussion started by feroz_shamsi.

Discussion 15 posts
Page 1 of 1
Open
Topic #6860 · 15 published posts · 1,877 views

 

 

Can we add a smiley on the fly in an Editbox of a dialog ? <wo0t>

 

like:

 

did -a dlgname 2 Hello $me (H) how are you :D ?

 

 

 

 

 

what i want is to Add text with smiley on the fly in dialog if anyone know how to do it reply plz !

 

 

Seeing as how emoticons are not default in mIRC's program or Dialog Studio, I highly doubt its possible in an editbox. But, you could use a did event to use an icon path for it

did -a dlgname 2 Hello $me pathto\icons\hoticon.ico how are you pathto\icons\smileyicon.ico ?

Something like that might work, not sure .. you can try it.

Yes, you can. You will just need to add a $replace command, and know $chr numbers. For instance, the $chr of : would be $chr(58) and the $chr of ) would be $chr(41).

 

You will also need to use something like nhtmln_2.95.dll to add an html window to your dialogs window. To get you started here is a code to do that with. Just replace <id> with your dialog windows id, and <dname> with your dialogs name...

 

on *:dialog:<dname>:init:*:{
 var %hwnd $dll($shortfn($findfile($mircdir,nhtmln_2.95.dll)),item,$dialog($dname).hwnd  id:<id>)
 dll $shortfn($findfile($mircdir,nhtmln_2.95.dll)) attach %hwnd
 dll $shortfn($findfile($mircdir,nhtmln_2.95.dll)) navigate about:blank
}

 

The above code will get your dialog ready to view smiles. Now, you will need the replace code. Here is an example of the replace code...

 

alias repsmiles {
 var %repsmiles = $1-
 %repsmiles = $replace(%repsmiles,$chr(58) $+ $chr(41),<img SRC=" $+ $shortfn($findfile($mircdir,smile.gif,1)) $+ ">)
 return %repsmiles
}

 

Now you will need the text event. Since you have an html window you can't use the regular commands you normally would to make text show up in the window. You will need to use html coding to add text to the window. Here is what you will need...

 

on *:TEXT:*:*: {
;This code is needed to select the html window where the text will go to. (used if you have two or more html windows opened)
 .echo -q $dll($shortfn($findfile($mircdir,nhtmln_2.95.dll)),select,$dialog(<dname>).hwnd
;This code sends text to the window
 .echo -q $dll($shortfn($findfile($mircdir,nhtmln_2.95.dll)),execScript document.body.innerHTML=document.body.innerHTML+' $+ $nick $+ $repsmiles($1-) $+ <br>')
;This code is needed to scroll down
 .echo -q $dll($shortfn($findfile($mircdir,nhtmln_2.95.dll)),execScript scroll(0,9999999999))
}

 

...and that is it. Just add the codes you want replaced, and replace <dname> with your dialogs name along with changing <id> to your dialogs window dialogid. :)

Edited Jun 15, 2006 2:47 PM by Warrior124
Yes, you can. You will just need to add a $replace command, and know $chr numbers. For instance, the $chr of : would be $chr(58) and the $chr of ) would be $chr(41).

or use $asc :P

People are like slinkies; they're generally boring until you push them down stairs

$asc doesn't give all $chr characters, such as ",". However, you can use this alias to list characters for you...

 

alias characters {
 var %c = 1
 :next
 write characters.txt $chr(36) $+ chr $+ $chr(40) $+ %c $+ $chr(41) = $chr(%c)
 inc %c
 if (%c < 301) goto next
}

 

or if you want to know just one character you can use this code...

 

alias ch {
 var %c = 1
 set %ch $1-
 :next
 if ($chr(%c) == %ch) { echo -a $chr(36) $+ chr $+ $chr(40) $+ %c $+ $chr(41) | halt }
 else {
   inc %c
   if (%c < 300) goto next
 }
}

;format /ch ! or /ch ,

Edited Jun 15, 2006 6:40 PM by Warrior124

Thanks For the reply all (Y)

let me try this :P

I forgot all about $chr :wacko::blink:

i forgot how to say 'a' :blink:

I'm glad this topic has come up as it gives me a chance to address a question I've often thought about. Using bars.mdx to populate a list with icons on a toolbar, is it possible to have an icon as a %var that can change on certain events?

 

Example: I have an icon that is a nice shiny, green circle. I click it, and I connect to the last IRC server I was on. Upon connection the green icon is replaced with a shiny red circle icon. If I then click on the icon (button) it disconnects me from the server & becomes the green icon (button) again?

 

Possible?

Edited Jun 16, 2006 9:18 AM by Vegeta

Get the Tech outta here!

pretty sure it is ive seen it done before but as u know me i dont do mirc anymore so no idea how to ask ozzster or x-troutfish(fusion) or somthing...

you can use variables, as when your using bars, you normally need to implement the code on the side. With GD5's Custom Nicklist, it has a toolbar, which is customizeable, i just made an alias do to the icon assignment, and if it gets updated, i just recall the alias, and it updates the icons with whatever is placed in the storage place for the icons, in your case a variable, in mine a hash entry/ini file.

Yeah, I believe if you write it to a hash file, and/or use a refresh feature(sort of like a custom nicklist) you could be able to do that. Or, take time to learn picwin? DCX might help in something like this aswell

lol i cant get dcx to do anything <_< been messing with it for the past hr

Play around on mircscripts.org some .. DCX is harder to do, but its well worth it. Don't forget to read the helpfile :P

meh i hate it already, looks like more work involved -_-