Author Topic: Missing real help files for VBScripting.  (Read 5201 times)

KroontjesPen

  • Newbie
  • *
  • Posts: 9
Missing real help files for VBScripting.
« on: May 08, 2014, 11:22:11 AM »
As a very long time mIRC user I was looking for another IRC client to do scripting again because mIRC has his limits to.
After making IceChat look almost like mIRC I started to find out how the scripting was working.
Looking for help files or similar options I found it somewhat disappointing. 

Take your Basic Clone Scanner. It  seems for me a good script to start with.

Code: [Select]
Sub ONJOIN(Nickname,Host,Channel,ServerNumber)
'current checks just for #icechat channel, remove if line and last end if for all channels
if Channel = "#icechat" then
     'get the total nicknames in a channel, and only scan when greater then 1 nick
     TotalNicks=GetIdentifier("$nick(" & Channel & ",0)",ServerNumber)
     if TotalNicks > 1 then     
          'drop ident for host
          Host = mid(Host,instr(Host,"@")+1)
          for i = 1 to TotalNicks
             GetHost  = GetIdentifier("$nick(" & Channel & "," & i & ").mask")
             'drop the ~ident, and and just use host
             GetHost = mid(GetHost,instr(GetHost,"@")+1)                                         
             if GetHost = Host then
               if Nickname <> GetIdentifier("$nick(" & Channel & "," & i & ")") then
                 SendCommand "/echo -a ->> Found a clone in " & Channel & " - " & Nickname & " = " &     GetIdentifier("$nick(" & Channel & "," & i & ")") ,ServerNumber
                 PlaySound "clone.wav"
               end if
             end if 
          next
     End if
End if

End Sub

First I want to change the /echo command to write in the channel where the clones are.
Not in a or s channel.
Using the form search with /echo I could not find the way to do so. Only the a or s was given.
After try it by /msg , I found the way.  It takes me a lot of time so to find out.
SendCommand "/echo " & Channel & "  ->> Clones:" & Nickname & ", " & GetIdentifier("$nick(" & Channel & "," & i & ")") ,ServerNumber


If I look to the follow commands,
GetIdentifier("$nick(" & Channel & ",0)",ServerNumber)
GetIdentifier("$nick(" & Channel & "," & i & ").mask")
GetIdentifier("$nick(" & Channel & "," & i & ")

and those I found on the form,
GetIdentifier("$currentchannel",CurrentServerNumber)
ttime = GetIdentifier("$time",ServerNumber)
tdate = GetIdentifier("$date",ServerNumber)
tserver = GetIdentifier("$network",ServerNumber)
ect.

This let me think that is if a very important commando.
Where can I find the full explanation on it and for the other commands.

By testing the clone script I also found a error in a channel that I visit on my favourite server.
The var TotalNicks became $null. It takes me time again to find how this could be solved.
if TotalNicks = "$null" then TotalNicks = 0

The next change I like to make is printing in one line all the clones a nick has in a channel.


Furthermore it give in IceChat in the console window an error when I give in the /helpop command.
It gives no reaction while this is expected.

      ***** UnrealIRCd Help System *****
 -
 Server Commands Help.
 Specify your Question after the /HELPOP command.
 You will find all of the server commands and options
 available for use.
 If you need extra assistance please visit the server's
 help channel or ask an available IRCop.
 -
 /HELPOP USERCMDS - To get the list of User Commands
 /HELPOP OPERCMDS - To get the list of Oper Commands
 /HELPOP SVSCMDS  - Commands sent via U:Lined Server (Services)
 /HELPOP UMODES   - To get the list of User Modes
 /HELPOP SNOMASKS - To get a list of Snomasks
 /HELPOP CHMODES  - To get the list of Channel Modes
 /HELPOP OFLAGS   - To see the list of O:line Flags
 -
If I gives a full command then the text that I not in a channel appear.


Then there are tokens that giving some problems.
Take the . This is done by Right Alt + 5.
In the active channel is showing correctly but it is not sending to the members of that channel.
They sees nothing.
If you receiving in IceChat the then it is showing like €.

Hopefully I am not having to must difficulty to explore IceChat and can make scripts that I can show-off here.  :)

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Missing real help files for VBScripting.
« Reply #1 on: May 08, 2014, 04:53:03 PM »
The scripting documentation is very limited, but there is a large amount of it online.
Look at the IceChat 5 scripting style, this is for the VBScript side of things.

IceChat 7 is not UTF8 compatible, so you could have problems with certain characters.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Missing real help files for VBScripting.
« Reply #2 on: May 09, 2014, 06:05:39 AM »
If you have some specific questions about scripting, you can always ask in the #icechat channel on quakenet or right here on the forums.

Keep in mind, however, that if you are asking someone to write you an entire script, it might take a long time and you might not find very many who are willing to spend their time writing a script for you (there aren't that many who make scripts for icechat to begin with)
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

KroontjesPen

  • Newbie
  • *
  • Posts: 9
Re: Missing real help files for VBScripting.
« Reply #3 on: May 09, 2014, 12:59:53 PM »
It is not my intention to let someone else write a script for me.
Mostly I try to figure it out in exiting scripts how others do things.

The tip from Snerf where to look for the GetIdentifier command is what me helped further.
It replaced $identifiers in mIRC like Time and Date, Nick and Address, if I understand it well.
My challenges is now to test the different types of the GetIdentifier command that I can find and see what these do.

This is what I like to rewrite for here.

Code: [Select]
on 1:OP:#: {
  /echo -s In $chan @ voor $opnick door $nick
  if ($nick == ChanServ) goto done
  if ($chan == #x)         { /cs DEOP $chan $opnick  | goto done }
  if ($chan == #y) { /echo 3 -s Testing y | goto done }
  :done
}
Some times you, as a channel owner, don't want op's(@) to op others.
This way it seem that the server is overriding them. :)

That would be not a big problem I think? It the best thing to learned it. 

Keep well in mind that English is not my native languish. If something is not clear, ask me to clarify it. 

 

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Missing real help files for VBScripting.
« Reply #4 on: May 09, 2014, 01:29:53 PM »
Well, your nickname certainly made you look Dutch , its all good.

Converting from mIRC to IceChat VBSCript is quite different, the syntax is radically different.
For Op, you want to use the ONOP routine.
For the syntax of the routines/functions, in the Script editor, in the Scripts ta, select the "Script Events" menu item, and then choose IceChat 5 style, and select "On Op" or w/e you want. This helps that part out.
The same for VBScript Functions, gives you a list of a lot of the functions, like GetIdentifier().

Hope that helps out a bit, if not, please ask here, can help you out as you need.
The IceChat God

KroontjesPen

  • Newbie
  • *
  • Posts: 9
Re: Missing real help files for VBScripting.
« Reply #5 on: May 12, 2014, 01:42:45 PM »
In my effort to overcome the $null results for the TotalNicks in the clones script above I want to used the $numtok command.
After some hour's of trying I like to now if it is possible to do so. Here is the part for that.

Code: [Select]

 TNs=Nicks(Channel,ServerNumber)      ' nick list IE: Inkt KroontjesPen
 TNn=GetIdentifier("$numtok(" & TNs & ",32)", ServerNumber)
 SendCommand "/echo " & Channel & "  " & TNn     '  result IE: $numtok(Inkt KroontjesPen,32)  and not the expected number of spaces

A little hint please to go further tomorrow. This here a little more then one hour for midnight.  :wink:

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Missing real help files for VBScripting.
« Reply #6 on: May 12, 2014, 03:54:02 PM »
There is no $numtok identfiier.
And there is no need, because you can split the string in vbscript, using the Split() function
The IceChat God

KroontjesPen

  • Newbie
  • *
  • Posts: 9
Re: Missing real help files for VBScripting.
« Reply #7 on: May 12, 2014, 11:00:11 PM »
Thanks Snerf, I shall look in to that Split() function later today.

KroontjesPen

  • Newbie
  • *
  • Posts: 9
Re: Missing real help files for VBScripting.
« Reply #8 on: May 14, 2014, 12:48:15 AM »
That Split() function can gives me in deed the TotalNicks. Sadly the channel where I needed for has more safety build in.
The GetIdentifier("$nick(" & Channel & "," & 1 & ")") gives me not the 1e nick on the list from that channel but this: $nick(<#channel>,1).

In mIRC I have in the past put a script in that works well with clones. This is working with a temporary file.
The big challenges are to translate this kind of scripting ($ialchan($address($nick($chan,%clone.count1),2),$chan,0) in to IceChat's.

Maybe for a long rainy day to look deeper in to this stuff.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Missing real help files for VBScripting.
« Reply #9 on: May 14, 2014, 10:52:58 AM »
Don't know why your code wouldn't work (though I have a faint recollection that I've seen the problem before)

You could try this instead

Code: [Select]
SomeArray = Split(Nicks(Channel,ServerNumber), " ")

Then you could use SomeArray(0) to get the first nick SomeArray(1) for the second etc. UBound(SomeArray) + 1 would be the total number of nicks in the channel (arrays start from 0)
« Last Edit: May 14, 2014, 10:57:00 AM by Morio »
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

KroontjesPen

  • Newbie
  • *
  • Posts: 9
Re: Missing real help files for VBScripting.
« Reply #10 on: May 14, 2014, 02:13:26 PM »
With lot of try and error, # forgotten for channel, I have now a list of the nicks.
Tomorrow looking of the host by the nicks also can be find this way.
This is my result.

Code: [Select]
sub test()
    Channel = "#tweakers.net"
    ServerNumber = GetIDentifier("$ServerNumber")
    SomeArray = Split(Nicks(Channel,ServerNumber), " ")
    SendCommand "/echo -s " & Channel & ",  " & ServerNumber & ",  " & UBound(SomeArray) ' for testing
    for i =0 to UBound(SomeArray)
        SendCommand "/echo -s " & i & ", " & SomeArray(i)
    next
end sub


Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Missing real help files for VBScripting.
« Reply #11 on: May 14, 2014, 02:41:52 PM »
SendCommand "//echo -s " & i & " $nick(" & Channel & "," & SomeArray(i) & ").host"
The IceChat God

KroontjesPen

  • Newbie
  • *
  • Posts: 9
Re: Missing real help files for VBScripting.
« Reply #12 on: May 14, 2014, 10:53:45 PM »
Thanks for the tip Snerf. Tested just before breakfast and it is what I looking for.

Maybe it is logically to do it this way for all the channels.
Shall look into this in the evening here.


KroontjesPen

  • Newbie
  • *
  • Posts: 9
Re: Missing real help files for VBScripting.
« Reply #13 on: May 15, 2014, 01:58:44 PM »
After using the search, found about: Dim Host, Redim Host(0), Redim Preserve Host(i) and a lot off trying with extra SendCommand I think to give up.
Now I have a list but it seems that the instr() function is not working with that list.

The code:
Code: [Select]
sub test()
    Looking      = "@"                                      '   for testing instr()               
    Channel      = "#the-cats"
    ServerNumber = GetIDentifier("$ServerNumber")
    NickArray    = Split(Nicks(Channel,ServerNumber), " ")
    TotalNicks   = UBound(NickArray)
    Dim Host
    Redim Host(0)
    SendCommand "/echo -s " & Channel & " ,  " & ServerNumber & " ,  " & UBound(NickArray) & " ,  " & TotalNicks ' for testing
    for i =0 to TotalNicks
        Redim Preserve Host(i)
        Host(i)  =" $nick(" & Channel & "," & NickArray(i) & ").host"
        Found    = instr(Host(i),Looking)               '   for testing instr()
        SendCommand "/echo -s " & i & " >> " & Looking & " | " & Found & " << "  & Host(i) & " | "
    next
    SendCommand "/echo -s " & "Theo@Kroontjespen.net" & " , " & instr("Theo@Kroontjespen.net",Looking) & " |/| " & Host(0) & " , " & instr(Host(0),Looking)
end sub

The results with the "@":
Code: [Select]
15-mei-2014 22:00:35 | #the-cats, 1, 9, 9
15-mei-2014 22:00:35 | 0 >> @ | 0 << Duur@188-142-112-168.FTTH.ispfabriek.nl |
15-mei-2014 22:00:35 | 1 >> @ | 0 << CrazyA@a80-126-229-51.adsl.xs4all.nl |
15-mei-2014 22:00:35 | 2 >> @ | 0 << KroontjesP@i119120.upc-i.chello.nl |
15-mei-2014 22:00:35 | 3 >> @ | 0 << denz@37-251-75-60.FTTH.ispfabriek.nl |
15-mei-2014 22:00:35 | 4 >> @ | 0 << fludizz@palm.v6.kratjebierhosting.nl |
15-mei-2014 22:00:35 | 5 >> @ | 0 << IceChat9@2a02:58:4:8:db0:fb47:7c3:5d04 |
15-mei-2014 22:00:35 | 6 >> @ | 0 << Grotesmurf@azrael.smurfnet.eu |
15-mei-2014 22:00:35 | 7 >> @ | 0 << Theo@i119120.upc-i.chello.nl |
15-mei-2014 22:00:35 | 8 >> @ | 0 << Scrumpy@xs8.xs4all.nl |
15-mei-2014 22:00:35 | 9 >> @ | 0 << IceChat77@92-108-32-44.dynamic.upc.nl |
15-mei-2014 22:00:35 | Theo@Kroontjespen.net, 5 |/| Duur@188-142-112-168.FTTH.ispfabriek.nl, 0


In the last line you see that the @ give 5 on the test address  "Theo@Kroontjespen.net"
On the Host(0) with "Duur@188-142-112-168.FTTH.ispfabriek.nl" however a 0 (zero).

If I set Looking with the "K" then only this line is changed
15-mei-2014 22:23:33 | 2 >> K | 18 << KroontjesP@i119120.upc-i.chello.nl |
The "K" is on 18 ???

To make it more stranger I set looking with the "o".
The result with the "o":
Code: [Select]
15-mei-2014 22:33:09 | 0 >> o | 25 << Duur@188-142-112-168.FTTH.ispfabriek.nl |
15-mei-2014 22:33:09 | 1 >> o | 27 << CrazyA@a80-126-229-51.adsl.xs4all.nl |
15-mei-2014 22:33:09 | 2 >> o | 20 << KroontjesP@i119120.upc-i.chello.nl |
15-mei-2014 22:33:09 | 3 >> o | 25 << denz@37-251-75-60.FTTH.ispfabriek.nl |
15-mei-2014 22:33:09 | 4 >> o | 28 << fludizz@palm.v6.kratjebierhosting.nl |
15-mei-2014 22:33:09 | 5 >> o | 29 << IceChat9@2a02:58:4:8:db0:fb47:7c3:5d04 |
15-mei-2014 22:33:09 | 6 >> o | 20 << Grotesmurf@azrael.smurfnet.eu |
15-mei-2014 22:33:09 | 7 >> o | 25 << Theo@i119120.upc-i.chello.nl |
15-mei-2014 22:33:09 | 8 >> o | 28 << Scrumpy@xs8.xs4all.nl |
15-mei-2014 22:33:09 | 9 >> o | 23 << IceChat77@92-108-32-44.dynamic.upc.nl |
15-mei-2014 22:33:09 | Theo@Kroontjespen.net , 4 |/| Duur@188-142-112-168.FTTH.ispfabriek.nl , 25

BTW  The , (comma) by Host(0) & " , " (with space in front of the , ) give an other output than  Host(0) & ", ".
Duur@188-142-112-168.FTTH.ispfabriek.nl , 25  against $nick(#the-cats,Duur).host, 0. Look the comma.
Tricky things so simple comma.

Friday the hole day and Saturday till the evening a bit busy. Happy weekend that start here sooner. :)

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Missing real help files for VBScripting.
« Reply #14 on: May 15, 2014, 03:53:13 PM »
That wont work.

Found = instr(Host(i), Looking) because Host(i) = " $nick ....."

If you want it to do that properly, it would have to be:

Host(i)  = Getidentifier("$nick(" & Channel & "," & NickArray(i) & ").host");
Found = instr(Host(i), Looking)

Now Host(i) will have the actual nick host, not " $nick(...)"
The IceChat God