Avatar billede rohr Nybegynder
16. januar 2002 - 21:42 Der er 6 kommentarer og
1 løsning

mIRC scripting....

Nogle der ved hvor jeg kan finde nogle gode scripts til mIRC og er der nogle der ved hvor jeg kan finde nogle gode tutorials om scripting.
Avatar billede zeth Nybegynder
16. januar 2002 - 21:48 #1
Tryk F1 inde i mIRC.. der er en masse gode tutorials...
Avatar billede rohr Nybegynder
16. januar 2002 - 21:50 #2
D r jo bare help filen, og den har jeg tjekket igennem og jeg synes ikke rigtig der står noget om hvordan jeg scripter.
Avatar billede zeth Nybegynder
16. januar 2002 - 22:20 #3
Er det her ikke IRC scripting?!




Variables

Variables are temporary storage areas to which you can assign values which you can use later in your scripts.

If a variable is referred to and it doesnt exist, it returns the value $null. The $null value can be used in comparisons in if-then-else statements to control branching etc.

The following commands allow you to create and set the values of variables.

/set [-snzuN] <%var> [value]
This sets the value of %var to the specified value.

If you specify the -uN switch, %var is unset after N seconds, assuming it is not set again by another script. If you specify a zero for N, the variable is unset when the script finishes.

The -z switch decreases %var until it reaches zero and then unsets it.
The -n switch makes it treat value as plain text.

/unset [-s] <%var>
This unsets and removes the specified variables from the variables list. If you specify a variable with wildcard characters then all matching variables will be removed.

/unset %test*

This will remove all variables beginning with the word %test.

You can also set/unset dynamic variables using [] brackets:

vartest  {
  set %a [ $+ b ] 1
  set %a [ $+ c ] 2
  set %a [ $+ d ] 3

  echo ab = %ab
  echo ac = %ac
  echo ad = %ad

  unset %a [ $+ b ] %a [ $+ c ] %a [ $+ d ]
}

/unsetall
This unsets and removes all variables from the variables list.

/inc [-cszuN] <%var> [value]
This increases the value of %var by value.

If you specify the -uN switch, %var is increased by the value once and then %var is unset N seconds later, assuming it is not set again by another script.

The -c switch increases %var once per second.

The -z switch decreases %var until it reaches zero and then unsets it.

/dec [-cszuN] <%var> [value]
This decreases the value of %var by value.

If you specify the -uN switch, %var is decreased by the value once and then %var is unset N seconds later, assuming it is not set again by another script.

The -c switch decreases %var once per second.

The -z switch decreases %var until it reaches zero and then unsets it.

You can also use the equal sign to assign values to variables:

%i = 5
%xyzi = 3.14159
%count = $1

And you can perform the following operations on variables when using the equal sign:

%x = 5 + 1
%x = 5 - %y
%x = %x * 2
%x = %z / $2
%x = $1 % 3
%x = 2 ^ %w

You can only perform a single operation in an assignment at this time.

You can also use the $calc() identifier which allows you to perform complex calculations.

//echo 1 $calc(3.14159 * (2 ^ %x % 3) - ($ticks / (10000 + 1)))

For floating point numbers you can also use the $round(N,D) and $int(N) identifiers to handle precision of the decimal digits. The number of decimals is currently limited to 5 digits.

Local Variables
Local variables are variables that exist only for the duration of the script in which they are created and can only be accessed from within that script. They can be created with the /var command:

/var %x

This creates the local variable %x in the current routine and can only be referenced from inside this routine.

/var %x = hello

This creates a local variable %x and assigns it the value hello.

You can create multiple local variables by separating them with commas:

/var %x = hello, %y, %z = $me

loop {
  var %x = 1
  :next
  echo item %x
  inc %x
  if (%x < 10) goto next
}

Note: you can use /var -s to make a variable show the result when a value is set.

Identifiers

$var(%var,N)
Returns the Nth matching variable name.

Properties: value, local

You can use a wildcard in the variable name.

If N = 0, returns total number of matching variable names.

Note: This searches both local and global variables.
Avatar billede rohr Nybegynder
17. januar 2002 - 17:51 #4
Jo sikkert men jeg lærer sq ik så meget af d vel.
Avatar billede jayf Nybegynder
17. januar 2002 - 17:53 #5
Avatar billede zeth Nybegynder
17. januar 2002 - 18:10 #6
lol...
Avatar billede dj_raprap Nybegynder
10. september 2003 - 09:14 #7
Rohr, du kommer bare ind i #AngeL_BaBe hvis du en dag får brug for noget hjælp, eller skal have lavet noget ;-)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester