mIRC Home    About    Download    Register    News    Help

Print Thread
#127664 15/08/05 09:18 PM
Joined: Aug 2005
Posts: 3
T
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
}

#127665 15/08/05 10:13 PM
Joined: Dec 2002
Posts: 417
O
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]

#127666 15/08/05 10:28 PM
Joined: Dec 2002
Posts: 3,547
S
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

#127667 15/08/05 10:36 PM
Joined: Aug 2005
Posts: 3
T
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

#127668 15/08/05 10:42 PM
Joined: Aug 2005
Posts: 3
T
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

#127669 16/08/05 12:13 AM
Joined: Aug 2005
Posts: 1,052
L
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* }
#127670 16/08/05 12:14 AM
Joined: Aug 2005
Posts: 128
S
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

#127671 16/08/05 07:18 PM
Joined: Dec 2002
Posts: 3,547
S
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

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


Link Copied to Clipboard