mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: Colorbar script problems, [Re: Mpot] #186323 20/09/07 10:28 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Ok, I see.

Code:
on addbar:TEXT:!addbar *:#: {
  write C:\IcyBot\Scripts\test.mrc on *:text: $+ $2 $+ :#: msg chan $3-
  notice $nick Bar added.
}


Just make absolutely sure that you use $read with the "n" parameter when reading from the text file so that the text isn't evaluated. Otherwise, someone can for your script to make you disconnect, delete your files, or just about anything else.


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186324 20/09/07 10:45 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Ah, I only plan on allowing myself to access this script, it seems to have too many possible exploits.

Also, I hate to put you through this, but I just updated my format to

Code:
if ($strip($$1) == -trigger) { msg $chan colorbarhere | halt }


!addbar trigger colorbar


And it'd add it to the last line, with the trigger in one place and the colorbar in the second. I'm going to attempt this one myself, can you tell me if it's good? I need the halt command written in like that as a part of the bar code, not to halt the /write script. I dunno if I did it properly.

Code:
on addbar:TEXT:!addbar *:#: {
  write C:\IcyBot\Scripts\callup_banners.mrc if ($strip($$1) == $+ $$2 $+) { msg $chan $$3 | halt }
  notice $nick Bar added.
}

Last edited by Mpot; 20/09/07 11:20 PM.
Re: Colorbar script problems, [Re: Mpot] #186329 20/09/07 11:28 PM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: Mpot
I'm going to attempt this one myself, can you tell me if it's good? I need the halt command written in like that as a part of the bar code, not to halt the /write script. I dunno if I did it properly.

Code:
on addbar:TEXT:!addbar *:#: {
  write C:\IcyBot\Scripts\callup_banners.mrc if ($strip($$1) == $+ $$2 $+) { msg $chan $$3 | halt }
  notice $nick Bar added.
}


Code:
on addbar:TEXT:!addbar & &:#:{
  write C:\IcyBot\Scripts\callup_banners.mrc if ($strip($1) == $2) $chr(123) msg $!chan $3 $chr(124) halt $chr(125)
  notice $nick Bar added.
}


PS if the bot is in C:\IcyBot you can more simply use "write Scripts\callup_banners.mrc ...."
Or perhaps $+($scriptdir,callup_banners.mrc)

Re: Colorbar script problems, [Re: deegee] #186330 20/09/07 11:43 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Code:
on *:TEXT:-*:#:{
  if (%banners == off) { msg $chan Banners are disabled. | halt }
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 } 
  if ($strip($$1) == -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 got this off someone else. I'd just use on TEXTs for each bar, but I need the %banners...

Re: Colorbar script problems, [Re: Mpot] #186332 20/09/07 11:48 PM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
See PM smile

Re: Colorbar script problems, [Re: deegee] #186333 20/09/07 11:57 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Alright, new thing. Does this work:

The write code that you came up with:

Code:
on addbar:TEXT:!addbar *:#:{
  var %file = C:\IcyBot\Scripts\test.mrc

  var %line = -il1,%a = $+(*:text:,$2,:*)
  ^^ %Line is set to -il1 (Insert at line 1) (Used with /write)

  ; check if you have an event for that text (%line will then be -l<N>)
  if $read(%file,wn,%a) { var %line = -l $+ $readn }

  ; write the line, overwriting if it exists, else added at line 1.
  write %line $qt(%file) on $+(*:text:,$2,:#:msg) $!chan $$3-

  ; reload the script so it will take effect
  .reload -rs %file
  ; advise user that line was added
  notice $nick Bar added.
}


Code:
on bannercontrol:text:!banners_off::/disable #banners | notice $nick Banners disabled.
on bannercontrol:text:!banners_on:?:/enable #banners | notice $nick Banners enabled.
on bannercontrol:text:!banners_off:#:/disable #banners | msg $chan Banners disabled.
on bannercontrol:text:!banners_on:#:/enable #banners | msg $chan Banners enabled.


Code:
#banners on
...
on *:TEXT:-*:#:{
  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
  ...
  #banners end


Will that make it to where they either work, or don't, depending on !banners_on or !banners_off?


I tried that and got some shitty message:

" * No groups needed to be changed "

and when I just leave it with #banners on and try -mpot I get

" ON Unknown command "

If we can figure out how to make those go away and have the groups work properly, and then use the write you came up with, but modify it so it puts in the line before the

...
#banners end

Then we're set. Any ideas?

Last edited by Mpot; 21/09/07 12:35 AM.
Re: Colorbar script problems, [Re: Mpot] #186346 21/09/07 04:07 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You're missing a } at the end (before #banner end). Also, those "..." shouldn't be there.


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186355 21/09/07 02:30 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
The "..." were in the /help file

Re: Colorbar script problems, [Re: Mpot] #186358 21/09/07 03:13 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
That's just to show you that the script goes there. ... either horizontal or vertical (when nothing else is on the line) indicates that something else can go there.


Invision Support
#Invision on irc.irchighway.net
Re: Colorbar script problems, [Re: Riamus2] #186363 21/09/07 04:09 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Er... whoops?

Re: Colorbar script problems, [Re: Mpot] #186376 21/09/07 08:12 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Nevermind.

Last edited by Mpot; 21/09/07 09:36 PM.
Page 2 of 2 1 2