mIRC Homepage
Posted By: tsilenzio Help Please! - 15/08/05 09:18 PM
Hello, I am doing a script for my channel I am about to set up called #Loans. I have writen the following but it does not work, what i would liek it to do is where someoe coems into the channel and types !loan <value> <value> and it annocies what he says and also records it into a text file called loans.txt plz help! help would be really appicated! Thanx!

on 1:TEXT:!loan %ammount %lenth:#Loans: {
/msg $chan $nick wants %ammount at $time on $date for %lenth
}
Posted By: Othello Re: Help Please! - 15/08/05 10:13 PM
Try this code


Code:
  
 [color:red] 
on 1:TEXT:!loan:#Loans: {
set %ammount $2
set %lenth $3-
msg $chan $nick wants %ammount at $time on $date for %lenth
} 

[/color]
Posted By: SladeKraven Re: Help Please! - 15/08/05 10:28 PM
Maybe something like:

Code:
On *:Text:!loan &amp; &amp;:#Loans: {
  var %msg = $nick wants $2 at $time on $date for $3
  if ($read(loans.txt,w,$+(*,$nick,*))) {
    write $+(-l,$readn) loans.txt $nick wants $calc($gettok($ifmatch,3,32) + $2) at $time for $3
    msg $chan Updated loan: $nick: $read(loans.txt,$readn)
  }
  else {
    write loans.txt %msg
    msg $chan %msg
  }
}


[16:27] <SladeKraven> !loan 50 1Week
[16:27] <Andy> SladeKraven wants 50 at 16:27:25 on 15/08/2005 for 1Week
[16:27] <SladeKraven> !loan 50 1Week
[16:27] <Andy> Updated loan for SladeKraven wants 100 at 16:27:32 for 1Week

As you can see it adds to the old loan.

-Andy
Posted By: tsilenzio Re: Help Please! - 15/08/05 10:36 PM
Well nice try but it dosent seem to work =/ thanx newayz! smile
Posted By: tsilenzio Re: Help Please! - 15/08/05 10:42 PM
yay it worked thanx SO much dude! lol now ima take the tiem to figure out how it works smile
Posted By: Lpfix5 Re: Help Please! - 16/08/05 12:13 AM
Quote:
Well nice try but it dosent seem to work =/ thanx newayz! smile


How dare you say it doesnt work LOL anything andy scripts it works laugh
Posted By: stefys99 Re: Help Please! - 16/08/05 12:14 AM
You should use the 'n' switch for $read() else people will be able to do:
Code:
!loan $findfile(.,*,1,quit) pwnt

And the bot quits IRC.
Since the command is public, that is a big problem smile
Posted By: SladeKraven Re: Help Please! - 16/08/05 07:18 PM
Lpfix5: I think he was actually replying to Othello.. laugh

stefys99: Yes you're right I should have added the n switch. Hard habbit to break out of though, just never ever put it in any of my code.

-Andy
Posted By: confuzzed Re: Help Please! - 17/08/05 12:53 AM
Andy is indeed a scripting god lol :tongue:
© mIRC Discussion Forums