IceChat Forums

IceChat 5 Scripting => Scripting => Topic started by: j4ck on October 07, 2011, 03:33:45 AM

Title: KickBan Help
Post by: j4ck on October 07, 2011, 03:33:45 AM
well im trying to make a kick ban, i can kick the person and everything, but when i ban them i can only ban them by nickname? im hoping to make it so i can Ban the person by Host then Kick them by name...

heres my code so far:
Code: [Select]
{ And } = added text, not to be used if copying and pasting...
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(lcase(Message,8)="*kickban" then
SendCommand "/mode " & Channel & " +b " & Mid(Message,10) {Or Some way to Get The Subjects Host} & "",ServerNumber
SendCommand "/Kick " & Channel & " " & Mid(Message,10) & " requested",ServerNumber
End If
End Sub
im pretty sure this should work but its not responsive even as it is...
but i still would like to know how to ban by host using the close to the same method, and im using 2 chat programs, so outtext wont work, im making my Icechat bot be hosted at a remote location (my friends house, he has great internet). Thanks in advance!
Title: Re: KickBan Help
Post by: Morio on October 07, 2011, 07:17:50 AM
You could use the $nick identifier to get the host

You might also want to use Nicks(Channel,ServerNumber) to check if the specified nick is on the channel.
Title: Re: KickBan Help
Post by: Snerf on October 07, 2011, 07:24:11 AM
The HOST is passed by the function.

Sub ONTEXT(Message,Channel,Nickname,""Host"",ServerNumber)
Title: Re: KickBan Help
Post by: j4ck on October 08, 2011, 02:22:20 PM
uhmm yeah, thanks morio, but! im really crappy at using identifiers and i find it makes my bot way laggy...

and Snerf, that gets the host of the person that sent the message, i dont think they want to kickban themselves!

and i just installed icechat on my dads computer but this keeps coming up!

Code: [Select]
[07:10]  ->> ERROR:modScriptFunctions:Function:RunScriptValue Error Number:-2147467259 : The operation could not be completed because the script engine has not been initialized to a valid language.
i dont really know what i did wrong, but i just really need to fix it!
Title: Re: KickBan Help
Post by: j4ck on October 08, 2011, 02:57:19 PM
uhmmm, bot sure if it matters, but you made a mistake on ( under GetIniFile, GetIniFile(“FileName.ini”,”Section,”Key”,”DefaultValue”) should be
GetIniFile(“FileName.ini”,”Section",”Key”,”DefaultValue”) im pretty sure, but if you want to leaeve it ignore my comment...
Title: Re: KickBan Help
Post by: Snerf on October 08, 2011, 06:06:01 PM
Ok, I can fix the typo.

Also, you do not need to use GetIdentifier, if you are sending the $identifier in a SendMessage call, it will be parsed properly still. You can use $nick(#channel, nick).host to get a host, the $ial could have it, many ways to do it.

It sounds like the program was not installed properly the other computer, make sure it installs with admin priveledges, If that is not the case, can't help you much further with, it just did not install properly.