SanZoR Posted August 2, 2007 Posted August 2, 2007 Hey, Do anybody know how to fix "slow scripts" problem? I have tried these stuff below: ----- 1. Clearing all .ini's 2. Reloading scripts very often. 3. Reconnecting MTA:mA very often. 4. Closing mIRC for few minutes, and load scripts again (Yes, this worked, but only for few minuts!) ----- What i should do? I run my scripts with very good computer, so computer specs are not a problem... Please help me with this! PS. Scripts are online 24/7 Finnish Multi Theft Auto Networks Community @ http://fin-mta.net OWNED 100mbit fiber linez ownz
lil Toady Posted August 3, 2007 Posted August 3, 2007 rewrite your scripts, 99% of time thats a problem of poor coding Do not PM me, im not going to read it anyway.
Oli Posted August 5, 2007 Posted August 5, 2007 also, for large database storage, i'd recommend using hash tables in your script Proud member of Multi Theft Auto Founder of Full Metal Jacket Creator of MTA:mA:GRS http://www.mtafmj.com http://www.full-fat.com
SanZoR Posted August 6, 2007 Author Posted August 6, 2007 Mm, im still on my GUS modification But i think the problem was money system for DD map winner. But i couldnt fix it myself, so i put my DM script here, if someone can fix or help me with it. Here it goes: alias mta.end { if (%cplayers == 1) { if ($readini(rs.ini,rs,$replace($mta.race($1),$chr(32),-)) == off) { var %a = 0,%b = 0 while (%a <= $mta.server($1).cmax) { if ($readini(alive&dead.ini,INFO,%a == Alive)) { if ($mta.nick($1,%a) != $null) { mta.text $1 $mta.nick($1,%a) is winner, and gets one more win and 10$ money! !writeini alive&dead.ini INFO %a DEAD !writeini -n money.ini MONEY $mta.nick($1,$2) $calc($readini(money.ini,MONEY,$mta.nick($1,$2)) + 10) !writeini -n wins.ini WINS $mta.nick($1,%a) $calc($readini(wins.ini,WINS,$mta.nick($1,%a)) + 1) !halt } } !inc %a } } } } on *:SIGNAL:mta.startrace: { var %aa = 0 set %cplayers $mta.server($1).players while (%aa <= $mta.server($1).cmax) { !writeini alive&dead.ini INFO %aa Alive !inc %aa } on *:SIGNAL:mta.endrace: { var %a = 0 !.remove alive&dead.ini !writeini -n bets.ini INFO timer down while (%a <= $mta.server($1).cmax) { !remini -n bets.ini %a betted !remini -n bets.ini %a bet !remini -n bets.ini %a money !inc %a } } on *:SIGNAL:mta.part: { var %a = 0 if ($readini(alive&dead.ini,INFO,$2 == Alive)) set %cplayers $calc(%cplayers - 1) !writeini alive&dead.ini INFO $2 DEAD mta.end $1 $2 } on *:SIGNAL:mta.death: { set %cplayers $calc(%cplayers - 1) !writeini alive&dead.ini INFO $2 DEAD mta.end $1 $2 } on *:SIGNAL:mta.connect: { set %cplayers 0 } on *:SIGNAL:mta.command:{ var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2) if ($3 == !players) mta.text $1 Players Alive: %cplayers $+ , Total Players: $mta.server($1).players if ($3 == !gamestat* iswm) { var %b = 0 while (%b <= $mta.server($1).cmax) { if ($mta.nick($1,%b) != $null) { mta.pm $1 $2 %b - $mta.nick($1,%b) Status: $iif($readini(alive&dead.ini,INFO, %b) == Dead, Dead, Alive) } !inc %b } } } on *:SIGNAL:mta.join: { !.timer 2 0 !writeini Alive&Dead.ini INFO $2 dead } All helps/fixed are welcome! Thanks in advance! Finnish Multi Theft Auto Networks Community @ http://fin-mta.net OWNED 100mbit fiber linez ownz
Winky Posted August 7, 2007 Posted August 7, 2007 also, for large database storage, i'd recommend using hash tables in your script I dont like hashes, becouse when mirc crashes its away!
lil Toady Posted August 7, 2007 Posted August 7, 2007 make it not to crash, or save the hash periodicaly on a timer, or with every entry. You can even load an ini into a hash table Do not PM me, im not going to read it anyway.
SanZoR Posted August 7, 2007 Author Posted August 7, 2007 Mm, im still on my GUS modification But i think the problem was money system for DD map winner. But i couldnt fix it myself, so i put my DM script here, if someone can fix or help me with it. Here it goes: alias mta.end { if (%cplayers == 1) { if ($readini(rs.ini,rs,$replace($mta.race($1),$chr(32),-)) == off) { var %a = 0,%b = 0 while (%a <= $mta.server($1).cmax) { if ($readini(alive&dead.ini,INFO,%a == Alive)) { if ($mta.nick($1,%a) != $null) { mta.text $1 $mta.nick($1,%a) is winner, and gets one more win and 10$ money! !writeini alive&dead.ini INFO %a DEAD !writeini -n money.ini MONEY $mta.nick($1,$2) $calc($readini(money.ini,MONEY,$mta.nick($1,$2)) + 10) !writeini -n wins.ini WINS $mta.nick($1,%a) $calc($readini(wins.ini,WINS,$mta.nick($1,%a)) + 1) !halt } } !inc %a } } } } on *:SIGNAL:mta.startrace: { var %aa = 0 set %cplayers $mta.server($1).players while (%aa <= $mta.server($1).cmax) { !writeini alive&dead.ini INFO %aa Alive !inc %aa } on *:SIGNAL:mta.endrace: { var %a = 0 !.remove alive&dead.ini !writeini -n bets.ini INFO timer down while (%a <= $mta.server($1).cmax) { !remini -n bets.ini %a betted !remini -n bets.ini %a bet !remini -n bets.ini %a money !inc %a } } on *:SIGNAL:mta.part: { var %a = 0 if ($readini(alive&dead.ini,INFO,$2 == Alive)) set %cplayers $calc(%cplayers - 1) !writeini alive&dead.ini INFO $2 DEAD mta.end $1 $2 } on *:SIGNAL:mta.death: { set %cplayers $calc(%cplayers - 1) !writeini alive&dead.ini INFO $2 DEAD mta.end $1 $2 } on *:SIGNAL:mta.connect: { set %cplayers 0 } on *:SIGNAL:mta.command:{ var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2) if ($3 == !players) mta.text $1 Players Alive: %cplayers $+ , Total Players: $mta.server($1).players if ($3 == !gamestat* iswm) { var %b = 0 while (%b <= $mta.server($1).cmax) { if ($mta.nick($1,%b) != $null) { mta.pm $1 $2 %b - $mta.nick($1,%b) Status: $iif($readini(alive&dead.ini,INFO, %b) == Dead, Dead, Alive) } !inc %b } } } on *:SIGNAL:mta.join: { !.timer 2 0 !writeini Alive&Dead.ini INFO $2 dead } All helps/fixed are welcome! Thanks in advance! Finnish Multi Theft Auto Networks Community @ http://fin-mta.net OWNED 100mbit fiber linez ownz
Winky Posted August 8, 2007 Posted August 8, 2007 make it not to crash, or save the hash periodicaly on a timer, or with every entry. You can even load an ini into a hash table true but i never tried
SanZoR Posted August 8, 2007 Author Posted August 8, 2007 Mm, im still on my GUS modification But i think the problem was money system for DD map winner. But i couldnt fix it myself, so i put my DM script here, if someone can fix or help me with it. Here it goes: alias mta.end { if (%cplayers == 1) { if ($readini(rs.ini,rs,$replace($mta.race($1),$chr(32),-)) == off) { var %a = 0,%b = 0 while (%a <= $mta.server($1).cmax) { if ($readini(alive&dead.ini,INFO,%a == Alive)) { if ($mta.nick($1,%a) != $null) { mta.text $1 $mta.nick($1,%a) is winner, and gets one more win and 10$ money! !writeini alive&dead.ini INFO %a DEAD !writeini -n money.ini MONEY $mta.nick($1,$2) $calc($readini(money.ini,MONEY,$mta.nick($1,$2)) + 10) !writeini -n wins.ini WINS $mta.nick($1,%a) $calc($readini(wins.ini,WINS,$mta.nick($1,%a)) + 1) !halt } } !inc %a } } } } on *:SIGNAL:mta.startrace: { var %aa = 0 set %cplayers $mta.server($1).players while (%aa <= $mta.server($1).cmax) { !writeini alive&dead.ini INFO %aa Alive !inc %aa } on *:SIGNAL:mta.endrace: { var %a = 0 !.remove alive&dead.ini !writeini -n bets.ini INFO timer down while (%a <= $mta.server($1).cmax) { !remini -n bets.ini %a betted !remini -n bets.ini %a bet !remini -n bets.ini %a money !inc %a } } on *:SIGNAL:mta.part: { var %a = 0 if ($readini(alive&dead.ini,INFO,$2 == Alive)) set %cplayers $calc(%cplayers - 1) !writeini alive&dead.ini INFO $2 DEAD mta.end $1 $2 } on *:SIGNAL:mta.death: { set %cplayers $calc(%cplayers - 1) !writeini alive&dead.ini INFO $2 DEAD mta.end $1 $2 } on *:SIGNAL:mta.connect: { set %cplayers 0 } on *:SIGNAL:mta.command:{ var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2) if ($3 == !players) mta.text $1 Players Alive: %cplayers $+ , Total Players: $mta.server($1).players if ($3 == !gamestat* iswm) { var %b = 0 while (%b <= $mta.server($1).cmax) { if ($mta.nick($1,%b) != $null) { mta.pm $1 $2 %b - $mta.nick($1,%b) Status: $iif($readini(alive&dead.ini,INFO, %b) == Dead, Dead, Alive) } !inc %b } } } on *:SIGNAL:mta.join: { !.timer 2 0 !writeini Alive&Dead.ini INFO $2 dead } All helps/fixed are welcome! Thanks in advance! I need to quote same shit over and over again... Im still looking for help! Finnish Multi Theft Auto Networks Community @ http://fin-mta.net OWNED 100mbit fiber linez ownz
Recommended Posts