mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Colorbar script problems, #186193 18/09/07 09:58 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
So I'm trying to make a script for my bot that spits out colorbars. I usually make them myself, but since this has become tedious, I decided that I'd automate the process. It's supposed to work where you specify the colors and your name, IE !colorbar 1 2 3 4 Mpot. Any ideas why it's not working?

Code:
on 1:text:!colorbar*:#: msg $chan $$1,0"0,$$1$$2,$$1"$$1,$$2$$3,$$2"$$2,$$3$$3,$$3"$$3,$$3$$4,$$3"$$3,$$41,1%%%%%%0 $$5 $$4,$$4%%%%%%$$3,$$4"$$4,$$3$$3,$$3"$$3,$$3$$2,$$3"$$3,$$2$$1,$$2"$$2,$$10,$$1"$$1,0


The is part of the bar itself, makes it look pretty.

Say I picked colors 11, 12, 2, and 10. And my name is Mpot. I'd go !colorbar 11 12 2 10 Mpot and I should get something back looking like this:


Last edited by Mpot; 18/09/07 10:10 PM.
Re: Colorbar script problems, [Re: Mpot] #186195 18/09/07 10:07 PM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
You can't squish things like this against the $ symbols. You need to $+ things together (or $+()). i.e.
Code:
on 1:text:!colorbar*:#: msg $chan  $+ $$1,0"0, $+ $$1 $+ ...


Re: Colorbar script problems, [Re: Bekar] #186197 18/09/07 10:09 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I'm still a little confused. Could you edit the entire script in that manner? I think I might be able to study it a little better in a completed fashion.

Re: Colorbar script problems, [Re: Mpot] #186198 18/09/07 10:51 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
on 1:text:!colorbar *:#: {
  if (!$5) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 nick | return }
  msg $chan $+(,$1,$chr(44),0"0,$chr(44),$1,$2,$chr(44),$1",$1,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$3,$chr(44),$3",$3,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$4,$chr(44),$4,------,0 $5,,$4,$chr(44),$4,-----,,$3,$chr(44),$4",$4,$chr(44),$3,$3,$chr(44),$3",$3,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,$1,$chr(44),$2",$2,$chr(44),$1,0,$chr(44),$1",$1,$chr(44),0)
}


There you are.


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186199 18/09/07 10:54 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Much thanks!

Re: Colorbar script problems, [Re: Riamus2] #186201 18/09/07 11:22 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Wait, we've got a problem. I just loaded up the script and tried it, and was returned:



Edit: I'm heading to sleep. I'll check through tomorrow.

Last edited by Mpot; 18/09/07 11:25 PM.
Re: Colorbar script problems, [Re: Mpot] #186203 19/09/07 12:00 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Fixed it. Just had to up the value of the $ by one. IE, $4 became $5

Code:
on 1:text:!colorbar *:#: {
  if (!$5) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 nick | return }
  msg $chan $+(,$2,$chr(44),0"0,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$5,$chr(44),$4",$4,$chr(44),$5,$5,$chr(44),$5,------,0,$6-,,$5,$chr(44),$5, -------,,$4,$chr(44),$5",$5,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$3,$chr(44),$4",$4,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,0,$chr(44),$2",$2,$chr(44),0)
}


There should be a simple edit to make it to where the color of the name text can be specified in the middle, but I can't seem to figure it out. Help?

Re: Colorbar script problems, [Re: Mpot] #186205 19/09/07 12:17 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
on 1:text:!colorbar *:#: {
  if (!$5) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 nick | return }
  msg $chan $+(,$2,$chr(44),0"0,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$5,$chr(44),$4",$4,$chr(44),$5,$5,$chr(44),$5,------,$6,$7,,$5,$chr(44),$5,-----,,$4,$chr(44),$5",$5,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$3,$chr(44),$4",$4,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,0,$chr(44),$2",$2,$chr(44),0)
}


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186229 19/09/07 04:08 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I love you. :P

Re: Colorbar script problems, [Re: Mpot] #186233 19/09/07 05:31 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You may want to adjust the "error" line to use !$6 instead of !$5 now that there is another color. Up to you.


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186244 19/09/07 09:33 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I don't exactly understand what that line does, but if you think it'll help, I shall. Thanks.

Re: Colorbar script problems, [Re: Mpot] #186246 19/09/07 09:58 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I did that, and now it doesn't work when I use 0(white) as the name color. I changed it back to 5, worked fine again.

Re: Colorbar script problems, [Re: Mpot] #186248 19/09/07 10:20 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Nevermind, I was able to figure it out myself.

Last edited by Mpot; 19/09/07 11:02 PM.
Re: Colorbar script problems, [Re: Mpot] #186254 19/09/07 11:05 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Here's a rewrite that will avoid problems when the last item is 0.

Code:
on 1:text:!colorbar *:#: {
  if ($7 == $null) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 color5 nick | return }
  msg $chan $+(,$2,$chr(44),0"0,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$5,$chr(44),$4",$4,$chr(44),$5,$5,$chr(44),$5,------,$6,$7,,$5,$chr(44),$5,-----,,$4,$chr(44),$5",$5,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$3,$chr(44),$4",$4,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,0,$chr(44),$2",$2,$chr(44),0)
}


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186255 19/09/07 11:09 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I was able to get everything working fine, I've got !colorbar4 and !colorbar5. Everything seemed to work fine with !$5, so I left it. Here they are:

Code:
on 1:text:!colorbar4 *:#: {
  if (!$5) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 nickcolor nick | return }
  msg $chan $+(,$2,$chr(44),0"0,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$5,$chr(44),$4",$4,$chr(44),$5,$5,$chr(44),$5,------,$6,$7-,,$5,$chr(44),$5,-----,,$4,$chr(44),$5",$5,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$3,$chr(44),$4",$4,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,0,$chr(44),$2",$2,$chr(44),0)
}

on 1:text:!colorbar5 *:#: {
  if (!$5) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 color5 nickcolor nick | return }
  msg $chan $+(,$2,$chr(44),0"0,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$5,$chr(44),$4",$4,$chr(44),$5,$6,$chr(44),$5",$5,$chr(44),$6,$6,$chr(44),$6,-------,$7,$8-,,$6,$chr(44),$6,-------,,$5,$chr(44),$6",$6,$chr(44),$5,$4,$chr(44),$5",$5,$chr(44),$4,$3,$chr(44),$4",$4,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,0,$chr(44),$2",$2,$chr(44),0)
}


Re: Colorbar script problems, [Re: Mpot] #186256 19/09/07 11:42 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I want to be able to add colorbars for callup to IcyBot's script with !addbar colorbargoeshere callupcommand

So

Code:
!addbar 11,0"0,1112,11"11,122,12"12,22,2"2,210,2"2,1010,10%%%%%%0 Master Mpot 10,10%%%%%%2,10"10,22,2"2,212,2"2,1211,12"12,110,11"11,0 -mpot


and the bot would write
Code:
on 1:TEXT:-mpot:#:msg $chan 11,0"0,1112,11"11,122,12"12,22,2"2,210,2"2,1010,10%%%%%%0 Master Mpot 10,10%%%%%%2,10"10,22,2"2,212,2"2,1211,12"12,110,11"11,0 halt


to the last line of the file. If there's text on the last line, it'd need to create a new line on the bottom and write that one in.

The .mrc is called Callup Banners.mrc and is located in C:\IcyBot\Scripts

Also, can you write it as a on TEXT, with the access level instead of one being addbar? Thanks!

(I could probably do it myself, but I can't seem to figure out hte command. I know one if $read, but I tried /help $write and got nothing.)
d

EDIT: Tinkered some, is it:

Code:
on addbar:TEXT:!addbar*:#: /write C:\IcyBot\Scripts on 1:text:- $+ $$2:#:msg $chan $$1 | halt

halt


?

Last edited by Mpot; 19/09/07 11:58 PM.
Re: Colorbar script problems, [Re: Mpot] #186257 20/09/07 12:00 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
/help /write smile

Anyhow, you really should adjust those IFs like I mentioned. $6 for the first one and $7 for the second one and check if they're == $null rather than !$___ as shown in what I gave you. It's up to you though. You don't have to use error checking at all. It will work without that line in there. If you're going to include the error checking, you should have it valid.


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186259 20/09/07 12:06 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I looked at the help /write, could you tell me if my attempt is vaild?

Edit:

Code:
on 1:text:!colorbar_how:#:/notice $nick To make a colorbar with five colors, you can type !colorbar5 color1 color2 color3 color4 color5 nickcolor nick. To make one with four colors, you may type !colorbar4 color1 color2 color3 color4 nickcolor nick. To access the list of colors, type -colors.

on 1:text:!colorbar4 *:#: {
  if ($6 == $null) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 nickcolor nick | return }
  msg $chan $+(,$2,$chr(44),0"0,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$5,$chr(44),$4",$4,$chr(44),$5,$5,$chr(44),$5,------,$6,$7-,,$5,$chr(44),$5,-----,,$4,$chr(44),$5",$5,$chr(44),$4,$4,$chr(44),$4",$4,$chr(44),$4,$3,$chr(44),$4",$4,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,0,$chr(44),$2",$2,$chr(44),0)
}

on 1:text:!colorbar5 *:#: {
  if($7 == $null) { msg $chan Invalid Format.  Use: !colorbar color1 color2 color3 color4 color5 nickcolor nick | return }
  msg $chan $+(,$2,$chr(44),0"0,$chr(44),$2,$3,$chr(44),$2",$2,$chr(44),$3,$4,$chr(44),$3",$3,$chr(44),$4,$5,$chr(44),$4",$4,$chr(44),$5,$6,$chr(44),$5",$5,$chr(44),$6,$6,$chr(44),$6,-------,$7,$8-,,$6,$chr(44),$6,-------,,$5,$chr(44),$6",$6,$chr(44),$5,$4,$chr(44),$5",$5,$chr(44),$4,$3,$chr(44),$4",$4,$chr(44),$3,$2,$chr(44),$3",$3,$chr(44),$2,0,$chr(44),$2",$2,$chr(44),0)
}


?




Also, if I wanted to add the /write line to the top of my colorbar script, would the correct parentheses format be

Code:
{ on addbar:TEXT:!addbar*:#: { /write C:\IcyBot\Scripts\test.mrc on 1:text:$$2:#:{ msg $chan $$1 | halt } } | /notice $nick Bar added. | halt }

Last edited by Mpot; 20/09/07 12:22 AM.
Re: Colorbar script problems, [Re: Mpot] #186265 20/09/07 02:25 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Your edit of those is correct.

For the writing...
Code:
on addbar:TEXT:!addbar *:#: {
  write C:\IcyBot\Scripts\test.mrc $2-
  notice $nick Bar added.
}


Note that you don't need /'s in a script. Also, I have no idea what you were trying to do with that line. You cannot put 2 on TEXT events on the same line. I'm not quite sure what you were trying to do there.

Anyhow, this will add the text after !addbar to that test.mrc file for you. I don't know that .mrc is the best ending for that file, though. .txt would probably make more sense as you're not adding lines of a script to that file... just text.


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186305 20/09/07 05:02 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Let me explain why I need the on text:

Code:
;Call-Up Banners

on *:TEXT:-mpot:#:msg $chan 11,0"0,1112,11"11,122,12"12,22,2"2,210,2"2,1010,10%%%%%%0 Master Mpot 10,10%%%%%%2,10"10,22,2"2,212,2"2,1211,12"12,110,11"11,0 | halt
on *:TEXT:-colors:#:msg $chan 0,1 1 0,2 2 0,3 3 0,4 4 0,5 5 0,6 6 0,7 7 0,8 8 0,9 9 0,10 10 0,11 11 0,12 12 0,13 13 0,14 14 0,15 15 | halt 
on *:TEXT:-duncan:#:msg $chan 9,0"0,910,9"9,102,10"10,22,2"2,23,2"2,33,3%%%%%%8 Duncan007 3,3%%%%%%2,3"3,22,2"2,210,2"2,109,10"10,90,9"9,0 | halt
on *:TEXT:-ichban:#:msg $chan 4,0"0,410,4"4,102,10"10,22,2"2,21,2"2,11,1%%%%%%0 IchbanRyushi 1,1%%%%%%2,1"1,22,2"2,210,2"2,104,10"10,40,4"4,0 | halt
on *:TEXT:-kuros:#:msg $chan 4,0"0,46,4"4,613,6"6,1313,13"13,1311,13"13,1111,11%%%%%%0 Kuros 11,11%%%%%%13,11"11,1313,13"13,136,13"13,64,6"6,40,4"4,0 | halt
on *:TEXT:-ekal:#:msg $chan 11,0"0,1112,11"11,122,12"12,22,2"2,210,2"2,1010,10%%%%%%0 Ekal 10,10%%%%%%2,10"10,22,2"2,212,2"2,1211,12"12,110,11"11,0 | halt
on *:TEXT:-lunaki:#:msg $chan 13,0"0,131,13"13,12,1"1,22,2"2,26,2"2,66,6%%%%%%0 Lunaki 6,6%%%%%%2,6"6,22,2"2,21,2"2,113,1"1,130,13"13,0 | halt
on *:TEXT:-marajah:#:msg $chan 3,0"0,31,3"3,15,1"1,55,5"5,52,5"5,22,2%%%%%%15 Marajah 2,2%%%%%%5,2"2,55,5"5,51,5"5,13,1"1,30,3"3,0 | halt
on *:TEXT:-kuro:#:msg $chan  6,0"0,62,6"6,212,2"2,1212,12"12,121,12"12,11,1------13Kuro-Sakura1,1-----12,1"1,1212,12"12,122,12"12,26,2"2,60,6"6,0 | halt
on *:TEXT:-peth:#:msg $chan 14,0"0,1415,14"14,151,15"15,11,1"1,17,1"1,77,7------0Penguin7,7-----1,7"7,11,1"1,115,1"1,1514,15"15,140,14"14,0 | halt
on *:TEXT:-vrixis:#:msg $chan 4,0"0,45,4"4,54,5"5,44,4"4,45,4"4,55,5------4Vrixis5,5-----4,5"5,44,4"4,45,4"4,54,5"5,40,4"4,0 | halt


I need the !addbar to add the inputed stuff (the bar and the callup code) to the end of that script, in an on text like the above...

Page 1 of 2 1 2