mIRC Home    About    Download    Register    News    Help

Print Thread
#134730 04/11/05 10:33 AM
Joined: Oct 2005
Posts: 35
C
Crap Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Oct 2005
Posts: 35
Oki, here is what i try to do:

Code:
on *:text:!turordning:#: {
  if (%RPGLogging == On) {
  [color:red]  msg $chan !turordningen: $read RPGLogg.txt 2-$2 [/color] 
  }
}

observe the line in red. It dosent work on my machine, so is there any other way..?


#indierpgs @ magicstar.net Your indie-rpg fix. Online.
#134731 04/11/05 12:26 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
try
msg $chan !turordningen: $read RPGLogg.txt 2- $+ $2

#134732 04/11/05 01:23 PM
Joined: Oct 2005
Posts: 35
C
Crap Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Oct 2005
Posts: 35
okej.. My misstake! What I ment were that the $read-command should read line 2 to $2. I know there is a comand that reads line $1-somethingelse, but is there anything backwards...


#indierpgs @ magicstar.net Your indie-rpg fix. Online.
#134733 04/11/05 02:46 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You cannot $read multiple lines with the $read command without using a loop.

Code:
on *:text:!turordning:#: {
  if (%RPGLogging == On && $2 isnum) {
    set -u60 %RPGLine $2
    set -u60 %RPGChan $chan
    set -u5 %RPGcnt 1
    play -af2 PlayRPGLog RPGLogg.txt 1000
  }
}

alias PlayRPGLog {
  inc -u5 %RPGcnt
  if (%RPGcnt >= %RPGLine) { play stop }
  msg %RPGChan !turordningen: $1-
}


That should do it for you with the least amount of I/O work. I also made is so that the variables would unset themselves so they aren't sitting there all the time. Because of using the alias, /var wouldn't work, so using -u was the best option.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard