View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:30 am



Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
 mIRC Scripting 
Author Message
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post mIRC Scripting
Does anyone here besides Daman and myself do it?

My Remote.ini file currently contains the following:
Code:
on *:TEXT:!set *:#drlchat: {
  if ( $$2 == n ) { /set %n $3 }
  if ( $$2 == x ) { /set %x $3 }
  if ( $$2 == y ) { /set %y $3 }
  if ( $$2 == z ) { /set %z $3 }
  if ( $$2 == m ) { /set %m $3 }
  if ( $$2 == m2 ) { /set %m2 $3 }
  else { /set $$2 $3- }
}

on *:TEXT:!variables:#drlchat: {
  /msg $chan n: %n  - x: %x  - y: %y - z: %z - m: %m - m2: %m2
}

on *:TEXT:!clearvar*:#drlchat: {
  if ( $2 == n ) { /set %n 0 }
  if ( $2 == x ) { /set %x 0 }
  if ( $2 == y ) { /set %y 0 }
  if ( $2 == z ) { /set %z 0 }
  if ( $2 == m ) { /set %m 0 }
  if ( $2 == m2 ) { /set %m2 0 }
  else { /set %n 0 | /set %x 0 | /set %y 0 | /set %z 0 | /set %m 0 | /set %m2 0 }
}

on *:TEXT:!calc *:#drlchat: {
  /msg $chan $calc($2-)
}
on *:TEXT:!help:#drlchat: {
  /msg $chan !calc <number> <operation> <number> - Calculates values. Use "%<variable>" for a variable.
  /msg $chan !set <variable> <value> - Sets n, x, y, z, m, and m2.
  /msg $chan !variables - Displays variable values.
  /msg $chan !clearvar <variable> - Clears specified variable, or all if unspecified.
}

on *:TEXT:!roll *:#drlchat: {
  set %target $3
  set %count 0
  :next
  if ( %count < %target ) && ( %target <= 5 ) {
    if ( $2 >= 256 ) { /msg $chan You rolled: $rand(1,256) | inc %count | goto next }
    else { /msg $chan You rolled: $rand(1,$2) | inc %count | goto next }
  }
  else { /set %target 0 | goto done }
  :done
}


I'm available to explain the basics to people, generally.
Daman knows far more than I do, but, leave your pride at the door when asking him to teach for you.


Wed Oct 03, 2007 2:48 am
Profile
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post Re: mIRC Scripting
:shock: wtf does all that mean????? :shock:


Wed Oct 03, 2007 2:59 am
Profile

Joined: Sun Jun 24, 2007 6:13 am
Posts: 505
Reply with quote
Post Re: mIRC Scripting
It's a couple of scripts. There's his calc script, and his cideroll script. Also, Girf forgot to include me.


Wed Oct 03, 2007 11:45 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: mIRC Scripting
Pyrorex wrote:
It's a couple of scripts. There's his calc script, and his cideroll script. Also, Girf forgot to include me.


Well yes except for the minor problem that you fail horribly.

Anyways, Whitty, the calc script is fairly simple.

Code:
on *:TEXT:!set *:#drlchat: {
  if ( $$2 == n ) { /set %n $3 }
  if ( $$2 == x ) { /set %x $3 }
  if ( $$2 == y ) { /set %y $3 }
  if ( $$2 == z ) { /set %z $3 }
  if ( $$2 == m ) { /set %m $3 }
  if ( $$2 == m2 ) { /set %m2 $3 }
  else { /set $$2 $3- }
}


Basically, this is a variable set, for the calc script.
if ( $$2 == <variable> ) { /set %<variable> $3 }
Just means that if the second word after !set is n, x, y, z, m, or m2, it will set that variable as the third word after !set.

The else means that if $2, or the second word after !set, is not specified, it sets whatever is in there as everything from the third word onward ( $3- ).

Code:
on *:TEXT:!variables:#drlchat: {
  /msg $chan n: %n  - x: %x  - y: %y - z: %z - m: %m - m2: %m2
}


If someone types !variables in #drlchat, it will display:
n: <valueofn> - x: <valueofx> etc

Code:
on *:TEXT:!clearvar*:#drlchat: {
  if ( $2 == n ) { /set %n 0 }
  if ( $2 == x ) { /set %x 0 }
  if ( $2 == y ) { /set %y 0 }
  if ( $2 == z ) { /set %z 0 }
  if ( $2 == m ) { /set %m 0 }
  if ( $2 == m2 ) { /set %m2 0 }
  else { /set %n 0 | /set %x 0 | /set %y 0 | /set %z 0 | /set %m 0 | /set %m2 0 }
}


If someone types !clearvar, it checks if you asked it to clear a specific variable, or else clears all of them at once.

Code:
on *:TEXT:!calc *:#drlchat: {
  /msg $chan $calc($2-)
}


If someone types !calc, it'll "calc"ulate everything from the second word onward.

!help is fairly self explanatory. When someone types !help, it /msgs the channel the help text.

Code:
on *:TEXT:!roll *:#drlchat: {
  set %target $2
  set %count 0
  :next
  if ( %count < %target ) && ( %target <= 10 ) {
    if ( $3 >= 256 ) { /msg $chan You rolled: $rand(1,256) | inc %count | goto next }
    else { /msg $chan You rolled: $rand(1,$3) | inc %count | goto next }
  }
  else { /set %target 0 | goto done }
  :done
}


This is a fun one.
When someone types !roll, it does several things.
First, it sets the %target, or number of times to roll, to whatever the second word after !roll was.
It also makes sure that the %count variable is 0.
Then, :next, which is a part of the goto loop, is defined.
First, it checks whether %count is less than or equal to %target. So, if it's rolled less dice than it's been asked to, it will increment the %count variable, /msg the channel a random number from 1 to whatever the third word after !roll was, and then repeat the check, using the goto next.
If %count is NOT less than or equal to target, it will go to the else statement, which resets %target and cancels the goto loop process.

Now, there's some anti-spam features in there too, but they're fairly self explanatory.


Fri Oct 05, 2007 4:39 am
Profile
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post Re: mIRC Scripting
i appreciate you calmly informing me but i dont get it. well, i do, but only a bit :P . i dont use mirc much anyway.


Fri Oct 05, 2007 5:06 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: mIRC Scripting
You're quite welcome, and, yeah, if you wanna start doing mIRC scripting, this is not where to do it.


Fri Oct 05, 2007 5:08 am
Profile

Joined: Sun Jun 24, 2007 6:13 am
Posts: 505
Reply with quote
Post Re: mIRC Scripting
Yes yes we know you're an elitist bastard Grif.


Fri Oct 05, 2007 7:11 pm
Profile
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post Re: mIRC Scripting
Oh hi I do mirc scripting too.

Code:
on *:TEXT:*:#datarealm:{
  if ( !%spamanti [ $+ [ $nick ] ] ) {
    set %spamanti [ $+ [ $nick ] ] 0
    inc %spamanti [ $+ [ $nick ] ]
  }
  if ( %spamanti [ $+ [ $nick ] ] >= 3 ) {
    kick $chan $nick over 3 lines per two seconds
    unset %spamanti [ $+ [ $nick ] ]
    unset %spamvar1 [ $+ [ $nick ] ]
  }
  else if ( %spamanti [ $+ [ $nick ] ] ) {
    inc %spamanti [ $+ [ $nick ] ] 1
  }
  if ( %spamvar1 [ $+ [ $nick ] ] == $null ) {
    dec -u2 %spamanti [ $+ [ $nick ] ] 0
  }
}


I masturbate to my own bots:
Code:
on *:TEXT:? *:#drlchatf:{
  /msg #drlchat $read(helpscript.txt, s, $2 )
}

on *:TEXT:!remove *:#drlchat:{
  if ($nick ishop #drlchat ) {
    /write -ds $+ $2 helpscript.txt
    /msg #drlchat 9 $+ $2 successfully removed.
  }
  else { /msg #drlchat 4 $+ $nick is not an Op. }
}

on *:TEXT:!learn *:#drlchat:{
  if ($nick ishop #drlchat) {
    /write -ds $+ $2 helpscript.txt
    /write helpscript.txt $2  $+ $2 $+ : $+  $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20
    /msg #drlchat 9 $+ $2 successfully added.
  }
  else { /msg #drlchat 4 $+ $nick is not an Op. }
}


Thu Oct 18, 2007 12:13 am
Profile

Joined: Thu Sep 27, 2007 10:19 pm
Posts: 32
Reply with quote
Post Re: mIRC Scripting
:/ I posted here 3 days ago... but it was deleted. xD


Here's a script creator I made awhile back :)...


Tue Oct 30, 2007 10:19 pm
Profile
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post Re: mIRC Scripting
BlueThen wrote:
:/ I posted here 3 days ago... but it was deleted. xD


Here's a script creator I made awhile back :)...


What? A script creator? What's that supposed to mean?

Re-attach it, it sounds interesting.


Thu Nov 08, 2007 11:51 pm
Profile

Joined: Thu Sep 27, 2007 10:19 pm
Posts: 32
Reply with quote
Post Re: mIRC Scripting
Sure.


Believe it or not, this is my very first dialog.


Fri Nov 09, 2007 3:25 am
Profile
User avatar

Joined: Thu Aug 09, 2007 6:37 pm
Posts: 889
Location: Not Jewtown.
Reply with quote
Post Re: mIRC Scripting
How does it work?

As in, how do I start it up.


Fri Nov 09, 2007 3:46 am
Profile WWW

Joined: Thu Sep 27, 2007 10:19 pm
Posts: 32
Reply with quote
Post Re: mIRC Scripting
Put it in your mirc folder, type '/load -rs ScriptCreator.mrc', then right click and click 'mIRC Editor' or type '/script'.


Fri Nov 09, 2007 5:10 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: mIRC Scripting
Ah, but, Bluethen, that doesn't support anything complex at all.

For instance; I made an entire text based combat system, including leveling, and Daman has made an entire movement system for map based combat.

Also, this should be moved to IRC Talk subforum.


Fri Nov 09, 2007 6:21 am
Profile
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post Re: mIRC Scripting
Wow, your program effectively overcomplicated everything. I'm just like WHAT'S HAPPENING ARRGH. Good job on coding it though, even though it's not very effective.


Fri Nov 09, 2007 6:40 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 32 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.184s | 14 Queries | GZIP : Off ]