IceChat Forums

IceChat 7 => IceChat 7 Scripts => Topic started by: j4ck on August 29, 2011, 04:09:44 AM

Title: Help With Variables
Post by: j4ck on August 29, 2011, 04:09:44 AM
i am wanting part of a code, in icechat 7 scripting (.ics)
this is what i got so far
Code: [Select]
on *:TEXT:*slap $1:#j4ck:/msg $chan $1 Gets Slappedthis is pretty simple, and im just wondering what would i use so i can merely type *slap Jack
and it types Jack Gets Slapped, i want it so i can do whatever name without having to add new code for the name.
Jack Also Wanders: can i use the variable $1 in multiple lines
Example
Code: [Select]
on *:TEXT:*slap $1:#j4ck:{/msg $chan $1 Gets Slapped
/timer Botkick 1 5 /kick $1
}
now i want it so i can type *slap JackBot and it automatically kicks Jackbot within 5 seconds.
im pretty noob at coding so any help is welcome! this works if i type in Jackbot *slap $1 but i want to be able to replace $1 with any name of my choice!
thanks, J4ck
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 01:20:43 PM
The mirc script engine in IceChat is not that sophisticated to do this, you would need to use the VB Script (IceChat 5 Style) script engine.
Title: Re: Help With Variables
Post by: j4ck on August 29, 2011, 02:18:35 PM
so in short its impossible to do in .Ics.
i've seen it done before though, in icechat 7 scripting to.
i just want it so i cant type any name in behind *slap and it does the following commands with the name i typed in.
i thought that would be simple enough.
but obviously not. heres some  :mrgreen: for your troubles!
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 02:30:38 PM
Well, if you have seen it done before, show us how it is done :)
Title: Re: Help With Variables
Post by: j4ck on August 29, 2011, 02:33:58 PM
oh and, I'm doing it in icechat 5 scripting, but can you please help me out by giving me the code  :lol:
and also can i have icechat 5 scripts and icechat 7 scripts loaded at the same time?
and I'm having troubles with the /load /unload commands here are the errors:
Code: [Select]
{1} [07:30] ->> {/unload :Unknown command and then when i try to reload it doesn't do anything, and yes I'm using icechat 7 scripting!
oh and also, snerf your my idol, you made icechat and yet you act like you just made a program that says Hello World. and you still dint think you made the coolest program (except for minecraft  :-) ) in the world, or rub it in other peoples faces. i just want you to know that one day some one like bill gates will buy your program for like 100 billion dollars, and when that happens, i think you'll decline because your awesome, so yeah...
Title: Re: Help With Variables
Post by: j4ck on August 29, 2011, 02:39:14 PM
also i think it was this i saw from morio
Quote
you could make an alias
Code: [Select]
/k:/kill $1 you have been killed by SniperPro for: $2-, If you would like to make a complaint please visit www.The-Brotherhood.org
then type '/k nickname reason'


could i do something like that except everyone can use it?
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 02:41:33 PM
Haha, ok, no need to suck up, it won't get you far :)

The /load and /unload commands are used for loading and unloading scripts, popup files, aliases, etc, make sure you use the right syntax.

Yes , you can mix ice5 and 7 style scripts, they just need to be in seperate files, as IceChat loads them according to their file extension. (ics for 7, ice for 5)

In the IceChat Editor, when you go to the Scripts tab, there is a menu called Script Events. Select this, and then IceChat 5 Style, and select ON TEXT. This will paste into the editor box the basics of how to declare an event.
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 02:43:10 PM
Well , as you should know, an alias is just a shortcut for a longer command. All commands start with a /, so only you can run these commands/aliases.

If you want others to run it, you have to use an ONTEXT type event, and check for !kill or whatever you w ant to call it.
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 02:54:11 PM
So what about something like this.

You type "slap Snerf" and it does just that.

Code: [Select]
on *:TEXT:*slap:#j4ck:{
/msg $chan $2 Gets Slapped
/timer Botkick 1 5 /kick $2
}
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 02:56:36 PM
Whoops, I think the text match needs to be slap* not *slap, my bad.
Title: Re: Help With Variables
Post by: j4ck on August 29, 2011, 03:02:00 PM
im not sucking up, im telling the truth, whats the point of sucking up anyway it doesnt get you anywhere.
and i know how to use icechat well, i am familiar with icechat 7 scripting, but not icechat 5.
but isnt there a way to make it so it copys what i say into the following command!
example
Code: [Select]
on *:text:*slap:#arandomchannel:{/msg #arandomchannel well $nick told me to slap you, so
/timer slap 1 5 /me Slaps (any name here) in the FACE
}
or something like that
isnt that possible?
and is the code you typed icechat 7?
or icechat 5 scripting?
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 03:13:00 PM
Why don't you try what I typed, and see what it does? And yes, that is Ice7 style.
Title: Re: Help With Variables
Post by: j4ck on August 29, 2011, 03:32:12 PM
i have tryed but all it says is $2 GETS SLAPPED
my first code works if i type J4ck *slap then it works, but otherwise, im bummed.
thanks for the help
Title: Re: Help With Variables
Post by: Snerf on August 29, 2011, 04:32:50 PM
Well , I tested mine to make sure, and it worked perfectly.
Title: Re: Help With Variables
Post by: j4ck on August 29, 2011, 11:44:31 PM
now mine doesnt even respond, i think my icechat is having a fit or something, it wont actually do any scripts, but it still loads them
Title: Re: Help With Variables
Post by: Snerf on August 30, 2011, 06:25:46 AM
If it doesn't respond, could very well be an error in the scripts.
Title: Re: Help With Variables
Post by: AnonStoner on September 19, 2011, 11:13:59 AM
Hey j4ck, so i got started a little bit ago as well, and a problem i was running into was scripts not running as i intended them to or not running at all.  The way i found to fix it is to put a close bracket in the line above each command you make to ensure the script only does what you tell it to. SO heres an example of what im interpreting your question as.

IN ALIAS:
Code: [Select]
/slapkick /me slaps the stuff out of $1  | /kick $1
What i did here was set "/slapkick" as a command to say "yournick slaps the stuff out of $1" AND kick whoever $1 was at the same time. The reason I would put this into aliases is because you can make your script trigger the alias.

IN SCRIPTS:
Code: [Select]
}
on *:TEXT:!slapkick:#: {
/slapkick $1
}

And with that, you should be set.  If that does not work or is too confusing, you can copy and paste this into your remote/scripts section and get the same result.
Code: [Select]
}
on *:TEXT:!slapkick:#: {
/me slaps the stuff out of $1
/kick $1 $2
}

And that should work.  basically, for any of those, anybody should be able to type !slapkick $1 and have your nick or bot slap and kick the user. For the last section of coding, $2 is defined as the reason, and you can take that out if you want. ^.^
Let me know if you need any more help.

-Jake