Author Topic: Help With Variables  (Read 5791 times)

j4ck

  • Newbie
  • *
  • Posts: 14
Help With Variables
« 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

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #1 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.
The IceChat God

j4ck

  • Newbie
  • *
  • Posts: 14
Re: Help With Variables
« Reply #2 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!

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #3 on: August 29, 2011, 02:30:38 PM »
Well, if you have seen it done before, show us how it is done :)
The IceChat God

j4ck

  • Newbie
  • *
  • Posts: 14
Re: Help With Variables
« Reply #4 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...

j4ck

  • Newbie
  • *
  • Posts: 14
Re: Help With Variables
« Reply #5 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?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #6 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.
The IceChat God

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #7 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.
The IceChat God

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #8 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
}
The IceChat God

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #9 on: August 29, 2011, 02:56:36 PM »
Whoops, I think the text match needs to be slap* not *slap, my bad.
The IceChat God

j4ck

  • Newbie
  • *
  • Posts: 14
Re: Help With Variables
« Reply #10 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?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #11 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.
The IceChat God

j4ck

  • Newbie
  • *
  • Posts: 14
Re: Help With Variables
« Reply #12 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

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help With Variables
« Reply #13 on: August 29, 2011, 04:32:50 PM »
Well , I tested mine to make sure, and it worked perfectly.
The IceChat God

j4ck

  • Newbie
  • *
  • Posts: 14
Re: Help With Variables
« Reply #14 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