| | 
| 
| 
|  |  
| 
KidSol
 |  
| KidSol | 
# 1 target ## 2 amount
 # 3 unit (k/m)
 
 br {
 //say 4-- Bombing Run4 $$1 with4 $$2 $+ $$3 jets. 4RAW (100% weapons) $4-
 //say 4--7 $round($calc($$2 / 1.1),2) $+ $$3 @ 110% --10 $round($calc($$2 / 1.15),2) $+ $$3 @ 115% --7 $round($calc($$2 / 1.2),2) $+ $$3 @ 120% --10 $round($calc($$2 / 1.25),2) $+ $$3 @ 125% --7 $round($calc($$2 / 1.3),2) $+ $$3 @ 130%
 //say 4--7 $round($calc($$2 / 1.35),2) $+ $$3 @ 135% --10 $round($calc($$2 / 1.4),2) $+ $$3 @ 140% --7 $round($calc($$2 / 1.45),2) $+ $$3 @ 145% --10 $round($calc($$2 / 1.5),2) $+ $$3 @ 150% --7 $round($calc($$2 / 1.55),2) $+ $$3 @ 155%
 //say 4--7 $round($calc($$2 / 1.6),2) $+ $$3 @ 160% --10 $round($calc($$2 / 1.65),2) $+ $$3 @ 165% --7 $round($calc($$2 / 1.7),2) $+ $$3 @ 170%
 //say 4-- Only send 33% of your jets MAX! Report what breaks!
 //say 4-- Do not attack with less than 88% readiness. Readiness targets in topic.
 }
 
 How can i make this work?
 |  |  |  
| 
| 
|  |  
| 
Joined:  Apr 2003 Posts: 701 Hoopy frood |  
|   Hoopy frood Joined:  Apr 2003 Posts: 701 | 
If it's triggered in on TEXT event: use msg $target instead of //sayYou can use $n (single $) for all but $$3 in the first line. If there are 3 parameters in the first line, there are still 3 parameters in the second line.
 It can flood you off the server very quickly, so have some floodprotection ebabled...
 
 But the question I should ask is: What doesn't work about it? or even What are you trying to do?
 |  |  |  
| 
| 
|  |  
| 
KidSol
 |  
| KidSol | 
I'm not really good in modifying the script.can you help me to modify it?
 can u make it trigger on text?
 It's a breaking calculator script
 |  |  |  
| 
| 
|  |  
| 
Joined:  Dec 2002 Posts: 1,245 Hoopy frood |  
|   Hoopy frood Joined:  Dec 2002 Posts: 1,245 | 
on *:TEXT:brcalc*:#: {
write -c brcalc.txt
write brcalc.txt msg $1 4-- Bombing Run4 $$1 with4 $$2 $+ $$3 jets. 4RAW (100% weapons) $4-
write brcalc.txt msg $1 4--7 $round($calc($$2 / 1.1),2) $+ $$3 @ 110% --10 $round($calc($$2 / 1.15),2) $+ $$3 @ 115% --7 $round($calc($$2 / 1.2),2) $+ $$3 @ 120% --10 $round($calc($$2 / 1.25),2) $+ $$3 @ 125% --7 $round($calc($$2 / 1.3),2) $+ $$3 @ 130%
write brcalc.txt msg $1 4--7 $round($calc($$2 / 1.35),2) $+ $$3 @ 135% --10 $round($calc($$2 / 1.4),2) $+ $$3 @ 140% --7 $round($calc($$2 / 1.45),2) $+ $$3 @ 145% --10 $round($calc($$2 / 1.5),2) $+ $$3 @ 150% --7 $round($calc($$2 / 1.55),2) $+ $$3 @ 155%
write brcalc.txt msg $1 4--7 $round($calc($$2 / 1.6),2) $+ $$3 @ 160% --10 $round($calc($$2 / 1.65),2) $+ $$3 @ 165% --7 $round($calc($$2 / 1.7),2) $+ $$3 @ 170%
write brcalc.txt msg $1 4-- Only send 33% of your jets MAX! Report what breaks!
write brcalc.txt msg $1 4-- Do not attack with less than 88% readiness. Readiness targets in topic.
.play $1 brcalc.txt
}
[code]
brcalc #channelname number(amount) KorM andwhatever$4-mightbe
if you want to be able to input the request yourself you might want to do it this way:
[code]
on *:TEXT:brcalc*:#: { brcalc $$1- }
alias brcalc {
  write -c brcalc.txt
  write brcalc.txt msg $1 4-- Bombing Run4 $$1 with4 $$2 $+ $$3 jets. 4RAW (100% weapons) $4-
  write brcalc.txt msg $1 4--7 $round($calc($$2 / 1.1),2) $+ $$3 @ 110% --10 $round($calc($$2 / 1.15),2) $+ $$3 @ 115% --7 $round($calc($$2 / 1.2),2) $+ $$3 @ 120% --10 $round($calc($$2 / 1.25),2) $+ $$3 @ 125% --7 $round($calc($$2 / 1.3),2) $+ $$3 @ 130%
  write brcalc.txt msg $1 4--7 $round($calc($$2 / 1.35),2) $+ $$3 @ 135% --10 $round($calc($$2 / 1.4),2) $+ $$3 @ 140% --7 $round($calc($$2 / 1.45),2) $+ $$3 @ 145% --10 $round($calc($$2 / 1.5),2) $+ $$3 @ 150% --7 $round($calc($$2 / 1.55),2) $+ $$3 @ 155%
  write brcalc.txt msg $1 4--7 $round($calc($$2 / 1.6),2) $+ $$3 @ 160% --10 $round($calc($$2 / 1.65),2) $+ $$3 @ 165% --7 $round($calc($$2 / 1.7),2) $+ $$3 @ 170%
  write brcalc.txt msg $1 4-- Only send 33% of your jets MAX! Report what breaks!
  write brcalc.txt msg $1 4-- Do not attack with less than 88% readiness. Readiness targets in topic.
  .play $1 brcalc.txt
}
this way you can type /brcalc (all the data) and people in channel can still post their brcalc request. |  |  |  
| 
| 
|  |  
| 
KidSol
 |  
| KidSol | 
   
on *:TEXT:!break*:#: { break $$1- }
alias break {
  write -c brcalc.txt
  write break.txt msg $1 4-- Bombing Run4 $$1 with4 $$2 $+ $$3 jets. 4RAW (100% weapons) $4-
  write break.txt msg $1 4--7 $round($calc($$2 / 1.1),2) $+ $$3 @ 110% --10 $round($calc($$2 / 1.15),2) $+ $$3 @ 115% --7 $round($calc($$2 / 1.2),2) $+ $$3 @ 120% --10 $round($calc($$2 / 1.25),2) $+ $$3 @ 125% --7 $round($calc($$2 / 1.3),2) $+ $$3 @ 130%
  write break.txt msg $1 4--7 $round($calc($$2 / 1.35),2) $+ $$3 @ 135% --10 $round($calc($$2 / 1.4),2) $+ $$3 @ 140% --7 $round($calc($$2 / 1.45),2) $+ $$3 @ 145% --10 $round($calc($$2 / 1.5),2) $+ $$3 @ 150% --7 $round($calc($$2 / 1.55),2) $+ $$3 @ 155%
  write break.txt msg $1 4--7 $round($calc($$2 / 1.6),2) $+ $$3 @ 160% --10 $round($calc($$2 / 1.65),2) $+ $$3 @ 165% --7 $round($calc($$2 / 1.7),2) $+ $$3 @ 170%
  write break.txt msg $1 4-- Only send 33% of your jets MAX! Report what breaks!
  write break.txt msg $1 4-- Do not attack with less than 88% readiness. Readiness targets in topic.
  .play $1 break.txt
}
No sure why it wouldn't work. I copy and paste it into my Remote When i use !break 500k  nothing happens Is it possible that i set up that only ppl i have set up the name can use it? 
Last edited by KidSol; 11/09/05 05:20 AM.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2004 Posts: 7,168 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2004 Posts: 7,168 | 
One problem I noticed right off, is the fact that you clear one text file in the alias, then you write and play a different text file.
 Also there's nothing included to return some kind of a response if any of the first 3 items are missing
 
 The alias would have to be called using break <item 1> <item 2> <item 3>
 
 Those first 3 are required or you won't get anything except for the file being cleared at the beginning of the alias
 
 So using your sample of  !break 500k  still needs at least two more parameters
 |  |  |  
| 
| 
|  |  
| 
KidSol
 |  
| KidSol | 
If i want to use only !break 500k
 what should i modify in the script?
 can u help me to do it?
 |  |  |  
| 
| 
|  |  
| 
Joined:  Dec 2002 Posts: 1,245 Hoopy frood |  
|   Hoopy frood Joined:  Dec 2002 Posts: 1,245 | 
on *:TEXT:!break*:#: { break $chan $$1- }
alias break {
  write -c break.txt
  write break.txt msg $1 4-- Bombing Run4 $2 with4 $3 $+ $4 jets. 4RAW (100% weapons) $4-
  write break.txt msg $1 4--7 $round($calc($3 / 1.1),2) $+ $4 @ 110% --10 $round($calc($3 / 1.15),2) $+ $4 @ 115% --7 $round($calc($3 / 1.2),2) $+ $4 @ 120% --10 $round($calc($3 / 1.25),2) $+ $4 @ 125% --7 $round($calc($3 / 1.3),2) $+ $4 @ 130%
  write break.txt msg $1 4--7 $round($calc($3 / 1.35),2) $+ $4 @ 135% --10 $round($calc($3 / 1.4),2) $+ $4 @ 140% --7 $round($calc($3 / 1.45),2) $+ $4 @ 145% --10 $round($calc($3 / 1.5),2) $+ $4 @ 150% --7 $round($calc($3 / 1.55),2) $+ $4 @ 155%
  write break.txt msg $1 4--7 $round($calc($3 / 1.6),2) $+ $4 @ 160% --10 $round($calc($3 / 1.65),2) $+ $4 @ 165% --7 $round($calc($3 / 1.7),2) $+ $4 @ 170%
  write break.txt msg $1 4-- Only send 33% of your jets MAX! Report what breaks!
  write break.txt msg $1 4-- Do not attack with less than 88% readiness. Readiness targets in topic.
  .play $1 break.txt
}
!break 500 try it like that 500k cant be calculated because its got the letter K Plus I made an error in not passing the channel name to the alias and not adjusting the $identifiers. As far as the rest of the code I didnt look that part over. If all you post is !break 500 then only the first line will have any value. |  |  |  
| 
| 
|  |  
| 
KidSol
 |  
| KidSol | 
Possible to limit to ppl who can use it?like i want nick1 and nick2  to use it only
 So i just set their name to the bot
 |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2004 Posts: 7,168 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2004 Posts: 7,168 | 
 on *:TEXT:!break*:#: {
if ($nick == <nick1>) || ($nick == <nick2>) {  break $chan $$1- }  If you find that you start getting a lot of people that you want to let use the command, but still don't want everyone to use it, you might use   on break:text:!breka*:#:{ break $chan $$1- }  Then add users using Access Levels /help Access Levels |  |  |  
| 
| 
|  |  
| 
DaveC
 |  
| DaveC | 
may i suggest something ? Well im going to anyway... Dont use the word BREAK since its an internal command, what a great way of causing scripts to collapse.   |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2004 Posts: 7,168 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2004 Posts: 7,168 | 
I just put break in as an example of a level that could be used to control the access to that command. |  |  |  | 
 |