mIRC Home    About    Download    Register    News    Help

Print Thread
Help Please! #127664 15/08/05 09:18 PM
Joined: Aug 2005
Posts: 3
T
tsilenzio Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Aug 2005
Posts: 3
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
}

Re: Help Please! #127665 15/08/05 10:13 PM
Joined: Dec 2002
Posts: 417
O
Othello Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
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]

Re: Help Please! #127666 15/08/05 10:28 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: Help Please! #127667 15/08/05 10:36 PM
Joined: Aug 2005
Posts: 3
T
tsilenzio Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Aug 2005
Posts: 3
Well nice try but it dosent seem to work =/ thanx newayz! smile

Re: Help Please! #127668 15/08/05 10:42 PM
Joined: Aug 2005
Posts: 3
T
tsilenzio Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Aug 2005
Posts: 3
yay it worked thanx SO much dude! lol now ima take the tiem to figure out how it works smile

Re: Help Please! #127669 16/08/05 12:13 AM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Help Please! #127670 16/08/05 12:14 AM
Joined: Aug 2005
Posts: 128
S
stefys99 Offline
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
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

Re: Help Please! #127671 16/08/05 07:18 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: Help Please! #127672 17/08/05 12:53 AM
Joined: Jan 2005
Posts: 59
C
confuzzed Offline
Babel fish
Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
Andy is indeed a scripting god lol :tongue: