Skip to content
MSN

nHTMLn_2.95.dll assistance

A TG007 community discussion started by shanespen.

Discussion 23 posts
Page 1 of 2
Open
Topic #6878 · 23 published posts · 2,482 views

I'm using nHTML to echo hammer icons when hosts talk, but all I can get it to do is navigate the entire chat window to the icon..

any way to fix this?

Tutorial

And if this doesn't work , i know Warrior can fix this , he's like the nHTMLn master or something :lmaojump: ..

Pomperom

lol, ty Ronan.

 

Here is what I have in WebchatZ5, available shortly...

 

alias roomstatus {
 if (!$1-) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $emdir $+ mbutterfly.gif" width="14" height="14"></small>'
 elseif ($1-) {
   if ($1- isowner $comchan($1-,1)) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $emdir $+ sysopgavel.gif" width="14" height="14"></small>'
   elseif ($1- isop $comchan($1-,1)) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $emdir $+ gavel.gif" width="14" height="14"></small>'
   elseif (*@snd iswm $ial($1-,1)) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $emdir $+ mbutterfly.gif" width="14" height="14"></small>'
   else .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+' $chr(160) $chr(160) $+ $chr(160) '
 }
}

on *:TEXT:*:#: {
 .dll $nhtmln select $window($chan).hwnd
 .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<b><basefont color="black" size=2 face=Verdana Border="1"><small> $+ $roomstatus($nick) $nick : <basefont color=" $+ $fontcolor($1-) $+ " size=2 face=Verdana Border="1"><small><small> $replace($em.filter($cg.filter($strip($1-))),$chr(10),,$chr(13),
,$chr(39),',$chr(266),Ċ,$chr(269),č,$chr(295),ħ) $+ </small></small></b><br>'
 .dll $nhtmln execScript scroll(0,9999999999)
}

thanks but i still can't get it to work lol @_@;

okay, can you show me the code you have, and I'll modify it to work for you? :)

alias roomstatus {
 if (!$1-) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ icons/bfly.gif" width="14" height="14"></small>'
 elseif ($1-) {
   if ($1- isowner $comchan($1-,1)) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ icons/owner.gif" width="14" height="14"></small>'
   elseif ($1- isop $comchan($1-,1)) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ icons/host.gif" width="14" height="14"></small>'
   elseif (*@snd iswm $ial($1-,1)) .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ icons/bfly.gif" width="14" height="14"></small>'
   else .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+' $chr(160) $chr(160) $+ $chr(160) '
 }
}

on *:TEXT:*:#: {
 .dll $nhtmln select $window($chan).hwnd
 .dll $nhtmln execScript document.body.innerHTML=document.body.innerHTML+'<b><basefont color="black" size=2 face=Verdana Border="1"><small> $+ $roomstatus($nick) $nick : <basefont color=" $+ $fontcolor($1-) $+ " size=2 face=Verdana Border="1"><small><small> $replace($em.filter($cg.filter($strip($1-))),$chr(10),,$chr(13),
,$chr(39),',$chr(266),Ċ,$chr(269),č,$chr(295),ħ) $+ </small></small></b><br>'
 .dll $nhtmln execScript scroll(0,9999999999)
}

 

the same code as yours, just changed the links to the icons.. and i made an alias nhtmln that returns the path to the DLL

plus, i'm using mirc 6.17..could that be the problem?

Edited Jun 19, 2006 7:45 PM by shanespen

Here is a code I came up with that you can use if you want, and I'll folow it with an explanation on how you can add icons to the beginning of text that will show the nicks status...

 

alias ff {
 if (!%ff. [ $+ [ $1- ] ]) || (!$exists(%ff. [ $+ [ $1- ] ])) set %ff. [ $+ [ $1- ] ] $shortfn($findfile($mircdir,$1-,1))
 return %ff. [ $+ [ $1- ] ]
}

alias fontcolor {
 if (07* iswm $1) || (7* iswm $1) { return orange }
 elseif (04* iswm $1) || (7* iswm $1) { return red }
 elseif (05* iswm $1) || (5* iswm $1) { return darkred }
 elseif (09* iswm $1) || (9* iswm $1) { return darkgreen }
 elseif (02* iswm $1) || (2* iswm $1) { return darkblue }
 elseif (03* iswm $1) || (3* iswm $1) { return green }
 elseif (06* iswm $1) || (6* iswm $1) { return purple }
 elseif (10* iswm $1) || (10* iswm $1) { return teal }
 elseif (01* iswm $1) || (15* iswm $1) { return silver }
 elseif (14* iswm $1) || (14* iswm $1) { return gray }
 elseif (09* iswm $1) || (9* iswm $1) { return lightgreen }
 elseif (12* iswm $1) || (12* iswm $1) { return blue }
 elseif (08* iswm $1) || (8* iswm $1) { return yellow }
 elseif (13* iswm $1) || (13* iswm $1) { return hotpink }
 elseif (11* iswm $1) || (11* iswm $1) { return bluegreen }
 else return black
}

alias roomstatus {
 if (!$1-) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(bfly.gif) $+ " width="14" height="14"></small>'
 elseif ($1-) {
   if ($1- isowner $comchan($1-,1)) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(owner.gif) $+ " width="14" height="14"></small>'
   elseif ($1- isop $comchan($1-,1)) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(host.gif) $+ " width="14" height="14"></small>'
   elseif (*@snd iswm $ial($1-,1)) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(bfly.gif) $+ " width="14" height="14"></small>'
   else .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+' $chr(160) $chr(160) $+ $chr(160) '
 }
}

on *:TEXT:*:#: {
 .dll $ff(nHTMLn_2.95.dll) select $window($chan).hwnd
 .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<b><basefont color="black" size=2 face=Verdana Border="1"><small> $+ $roomstatus($nick) $nick : <basefont color=" $+ $fontcolor($1-) $+ " size=2 face=Verdana Border="1"><small><small> $replace($strip($1-),$chr(10),,$chr(13),
,$chr(39),',$chr(266),Ċ,$chr(269),č,$chr(295),ħ) $+ </small></small></b><br>'
 .dll $ff(nHTMLn_2.95.dll) execScript scroll(0,9999999999)
}

 

I added a fontcolor alias so you can view the colors of people if you want. I also added an ff alias which works just like hard coding, but better, because it will find any file you put it with, and then store a variable so it won't have to scan for the file again.

 

 

Now, for an explanation on how the status works.

It is always best to use an alias for this, because if you put it directly into the on *:text event it will make the coding bigger, because of all the if, and else statements, and such. So, before you have the html of the incoming text written you will need to put the statuses before the "$nick : $1-". So, it will look like "$roomstatus($nick) $nick : $1-"

 

The way the alias "$roomstatus" works is it will scan the room where the incoming text took place for "$nick", and if the nickname is found will determine what status he/she is in. Then, it will add html coding to the beginning of the incoming text...

 

if ($1- isowner $comchan($1-,1)) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(owner.gif) $+ " width="14" height="14"></small>'

 

So then it adds a picture icon to the beginning of the text followed by the rest of the text. Hope this helps you. If you need anymore help please let us know, and we'd be glad to help. :)

 

P.S.: mIRC 6.17 won't create a problem for it. I am also using 6.17 as well. :)

Edited Jun 19, 2006 8:05 PM by Warrior124

i added it all, it finds the files and everything, but it doesn't do execute the script.. =\

You mean for "on *:TEXT" events? Can you tell me exactly what it does, or tell me if there are any errors, and such?

Edited Jun 19, 2006 8:32 PM by Warrior124

Well, it finds the files and stores their variables with the path to the file, but it doesn't show anything in the channel window.. =\

 

edit: maybe i need to register the dll? =\

Edited Jun 19, 2006 8:37 PM by shanespen

Hmm, you may have to show me all the code you have for your html addon. There might be something you haven't shown that maybe interfering with it. If you don't want to show it to everyone you can pm me it, and I'll try to help you.

alias ff {
 if (!%ff. [ $+ [ $1- ] ]) || (!$exists(%ff. [ $+ [ $1- ] ])) set %ff. [ $+ [ $1- ] ] $shortfn($findfile($mircdir,$1-,1))
 return %ff. [ $+ [ $1- ] ]
}

alias fontcolor {
 if (07* iswm $1) || (7* iswm $1) { return orange }
 elseif (04* iswm $1) || (7* iswm $1) { return red }
 elseif (05* iswm $1) || (5* iswm $1) { return darkred }
 elseif (09* iswm $1) || (9* iswm $1) { return darkgreen }
 elseif (02* iswm $1) || (2* iswm $1) { return darkblue }
 elseif (03* iswm $1) || (3* iswm $1) { return green }
 elseif (06* iswm $1) || (6* iswm $1) { return purple }
 elseif (10* iswm $1) || (10* iswm $1) { return teal }
 elseif (01* iswm $1) || (15* iswm $1) { return silver }
 elseif (14* iswm $1) || (14* iswm $1) { return gray }
 elseif (09* iswm $1) || (9* iswm $1) { return lightgreen }
 elseif (12* iswm $1) || (12* iswm $1) { return blue }
 elseif (08* iswm $1) || (8* iswm $1) { return yellow }
 elseif (13* iswm $1) || (13* iswm $1) { return hotpink }
 elseif (11* iswm $1) || (11* iswm $1) { return bluegreen }
 else return black
}

alias roomstatus {
 if (!$1-) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(bfly.gif) $+ " width="14" height="14"></small>'
 elseif ($1-) {
   if ($1- isowner $comchan($1-,1)) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(owner.gif) $+ " width="14" height="14"></small>'
   elseif ($1- isop $comchan($1-,1)) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(host.gif) $+ " width="14" height="14"></small>'
   elseif (*@snd iswm $ial($1-,1)) .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<small><img SRC=" $+ $ff(bfly.gif) $+ " width="14" height="14"></small>'
   else .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+' $chr(160) $chr(160) $+ $chr(160) '
 }
}

on *:TEXT:*:#: {
 .dll $ff(nHTMLn_2.95.dll) select $window($chan).hwnd
 .dll $ff(nHTMLn_2.95.dll) execScript document.body.innerHTML=document.body.innerHTML+'<b><basefont color="black" size=2 face=Verdana Border="1"><small> $+ $roomstatus($nick) $nick : <basefont color=" $+ $fontcolor($1-) $+ " size=2 face=Verdana Border="1"><small><small> $replace($strip($1-),$chr(10),,$chr(13),
,$chr(39),',$chr(266),Ċ,$chr(269),č,$chr(295),ħ) $+ </small></small></b><br>'
 .dll $ff(nHTMLn_2.95.dll) execScript scroll(0,9999999999)
}

 

that's all the code for nHTMLn that i have.. =\

everything else is like on mode, topic, join, events, and the html codes are in it's own file, webchat.mrc.. ^o)

okay, what do you have for your join event?

okay, what do you have for your join event?

just an if ($nick == $me) add access and an aop list scan

Just incase you should have something like this for your on join event...

 

on *:JOIN:#:{
 if ($nick == $me) {
   .dll $ff(nHTMLn_2.95.dll) select $window($chan).hwnd
   .dll $ff(nHTMLn_2.95.dll) attach $window($chan).hwnd
   .dll $ff(nHTMLn_2.95.dll) navigate about:blank
 }
}

Edited Jun 19, 2006 8:58 PM by Warrior124

that attaches the browser and then takes it to about:blank.. =\

i don't think i'm ever going to get this thing to show hammers when hosts talk @_@

That is what it is suppose to do. Then the html code will start working in it. Without the html window you won't get the html coding to working. When you join it is suppose to attach an html window to the channel window.

yeah, it's working now, except the images won't show..they just come up blank..

Okay, are the icons in your scripts directory?

yep, in \icons\

i uploaded the images and linked them, that works fine, but if the hosting goes down, it won't work..