stylo Posted March 15, 2007 Share Posted March 15, 2007 Can someone tell me, how i can make automessages in MTA. (script) Link to comment
BetaDevil Posted March 15, 2007 Share Posted March 15, 2007 on *:SIGNAL:mta.connect: { !.timer 0 500 mta.text $1 Message !.timer 0 550 mta.text $1 Message2 } Link to comment
stylo Posted March 15, 2007 Author Share Posted March 15, 2007 i can add more messages by adding this: !.timer 0 550 mta.text $1 And how can i set the time they come? Link to comment
2paq Posted March 15, 2007 Share Posted March 15, 2007 !.timer n t n - how many time t - time / interval Link to comment
lil Toady Posted March 15, 2007 Share Posted March 15, 2007 !.timer n t n - how many time t - time / interval if u set n to 0 it will repeat it non-stop after the interval u set bleh, just type '/help /timer' in mirc Link to comment
Scooby Posted March 15, 2007 Share Posted March 15, 2007 U should name the timer, or on connect, ul get loads of timers running. .timerspam1 0 600 mta.text $1 bla... .timerspam2 0 900 mta.text $1 bla... this way u can only have 1 timer called 'timerspam1' whereas u can have unlimited 'timer's Link to comment
Keslertje2005 Posted March 16, 2007 Share Posted March 16, 2007 Can't you just start and stop the messages with a command? Link to comment
Scooby Posted March 16, 2007 Share Posted March 16, 2007 Can't you just start and stop the messages with a command? Sure, but i dont think theres a way to stop individual unnamed timers. coz as it was b4, everytime u connect, a new timer is started, the old one didnt get stopped. so u would end up with tons of timers running and eventually loads of messages. Link to comment
stylo Posted March 16, 2007 Author Share Posted March 16, 2007 Can't you just start and stop the messages with a command? Sure, but i dont think theres a way to stop individual unnamed timers. coz as it was b4, everytime u connect, a new timer is started, the old one didnt get stopped. so u would end up with tons of timers running and eventually loads of messages. ahahah PS the script works fine! its nice, Thnx Link to comment
lil Toady Posted March 16, 2007 Share Posted March 16, 2007 Can't you just start and stop the messages with a command? Sure, but i dont think theres a way to stop individual unnamed timers. coz as it was b4, everytime u connect, a new timer is started, the old one didnt get stopped. so u would end up with tons of timers running and eventually loads of messages. Yeah there is a way to stop unnamed timers but it's a bit complicated. Every timer has it's own id, so you'll have to do a loop and check what every timer does and stop the needed one. Link to comment
Scooby Posted March 16, 2007 Share Posted March 16, 2007 Can't you just start and stop the messages with a command? Sure, but i dont think theres a way to stop individual unnamed timers. coz as it was b4, everytime u connect, a new timer is started, the old one didnt get stopped. so u would end up with tons of timers running and eventually loads of messages. Yeah there is a way to stop unnamed timers but it's a bit complicated. Every timer has it's own id, so you'll have to do a loop and check what every timer does and stop the needed one. theres no way to know how many unnamed timers there are tho, so ud just have to do a while loop up to some random amount and hope that u got them all, while in the processs of not stopping any other timers. if u name them then u dont have all this trouble. Link to comment
lil Toady Posted March 16, 2007 Share Posted March 16, 2007 there is a way to know how many timers you have $timer(0) Link to comment
Scooby Posted March 17, 2007 Share Posted March 17, 2007 there is a way to know how many timers you have $timer(0) But there is no way to know which unnamed timers are for ur auto messages and which are for other stuff. its up to u.. dont name them if u dont want to. Link to comment
lil Toady Posted March 17, 2007 Share Posted March 17, 2007 there is a way to know how many timers you have $timer(0) But there is no way to know which unnamed timers are for ur auto messages and which are for other stuff. its up to u.. dont name them if u dont want to. yes you can! if (mta.say* iswm $timer(ID).com) {} Well yeh you can get anything from a timer, but it's easier to name them Link to comment
Scooby Posted March 17, 2007 Share Posted March 17, 2007 u mean mta.text and u know what i mean, even if u use that u still dont know which timers ur stopping. some of the timers may also be mta.text timers, but not timers for ur auto messages. we could go on forever here... /me slaps toady... u know naming them is the best option. Link to comment
{_AntiFreak_} Posted September 25, 2007 Share Posted September 25, 2007 would that work? on *:SIGNAL:mta.command: { if ($3 == !advert) { if ($mta.level($1,$2) >= 5) { if (!$4) mta.pm $1 $2 Error - Set an advert-Message else { set %advertmsg $4- set %advert 1 .timer 1 60 !.signal mta.advert $1 } } else mta.pm $1 $2 Error - You need to be level 5 to use this command } elseif ($3 == !stopadvert) { if ($mta.level($1,$2) >= 5) { unset %advert unset %advertmsg mta.text $1 Advert stopped } else mta.pm $1 $2 Error - You need to be level 5 to use this command } } on *:SIGNAL:mta.advert: { if (%advert == 1) { mta.text %advermsg .timer 1 60 !.signal mta.advert $1 } } Link to comment
SDK Posted September 25, 2007 Share Posted September 25, 2007 This is how I would do it: on *:SIGNAL:mta.command: { if ($3 == !advert) { if ($mta.level($1,$2) = 5) { if ($4 == $null) mta.pm $1 $2 Error - Set an advert-Message else { mta.text $1 Advert $iif(!timer(mta.advert),changed,added) .timermta.advert 0 60 mta.text $1 $4- } } else mta.pm $1 $2 Error - You need to be level 5 to use this command } elseif ($3 == !stopadvert) { if ($mta.level($1,$2) = 5) { if ($timer(mta.advert)) { .timermta.advert off mta.text $1 Advert stopped } else mta.pm $1 $2 Error - No advert found } else mta.pm $1 $2 Error - You need to be level 5 to use this command } } I would prefer mine cause you are using a variable, your timer would never stop and your using a signal And you forgot your $1 at line 24 Link to comment
{_AntiFreak_} Posted September 26, 2007 Share Posted September 26, 2007 but before every advertisement it checks if %advert is 1, so you can stop it. and i WANT that it won't stop until i deactivate it. But the question was, if it would work. I Tested it yesterday but it didn't work, i have addet the $1 behind mta.text but the advertisement isn't shown. Link to comment
SDK Posted September 26, 2007 Share Posted September 26, 2007 I think I saw another thing at line 24 mta.text %advermsg %advermsg = %advertmsg ? Link to comment
[UVA]Bart Posted September 26, 2007 Share Posted September 26, 2007 how many different adverts do you want ? Link to comment
{_AntiFreak_} Posted September 28, 2007 Share Posted September 28, 2007 i want to show these adverts avery minute untill i stop it Link to comment
[UVA]Bart Posted September 28, 2007 Share Posted September 28, 2007 right this is what i come up with :- you can set as many adverts as you want and they show a random one every 5 mins so it doesnt flood the chat box let me know how you go on any probs post here. !addadvert !startads !stopads on *:SIGNAL:mta.command { if ($3 == !addadvert) { if ($mta.level($1,$2) < 5) mta.pm $1 $2 Error: Incorrect Level if ($4 == $null) mta.pm $1 $2 Error: !addadvert <advert> else { if ($mta.level($1,$2) >= 5) { !writeini -n adverts.ini advert $calc($slr.adverts($1) + 1) $4- !writeini -n adverts.ini adverts total $calc($slr.adverts($1) + 1) mta.pm $1 $2 Advert Added Correctly } } } elseif ($3 == !startads) { if ($mta.level($1,$2) < 5) mta.pm $1 $2 Error: Incorrect Level else { !writeini -n adverts.ini adverts ads start .timerads 0 300 slr.advertstime $1- mta.pm $1 $2 Succes In Starting The Ads } } elseif ($3 == !stopads) { if ($mta.level($1,$2) < 5) mta.pm $1 $2 Error: Incorrect Level else { !writeini -n adverts.ini adverts ads stop mta.pm $1 $2 Succes In Stopping The Ads } } } alias slr.adverts !return $iif($readini(adverts.ini,adverts,total) == $null,0,$v1) alias slr.advertstime { var %a = $rand(0,$slr.adverts($1)) var %b = $readini(adverts.ini,adverts,ads) if (%b == start) { mta.text $1 Advert: $readini(adverts.ini,advert,%a) } } Link to comment
Scooby Posted September 29, 2007 Share Posted September 29, 2007 line 4 should start with 'elseif' also, lines 6 and 10 arent needed. (maybe im just being picky ) looks fine apart from that. tip: u could use $ini(ininame.ini,topic,0) to get the total, which would save writing/storing it. Link to comment
[UVA]Bart Posted September 29, 2007 Share Posted September 29, 2007 line 4 should start with 'elseif' also, lines 6 and 10 arent needed. (maybe im just being picky ) looks fine apart from that. tip: u could use $ini(ininame.ini,topic,0) to get the total, which would save writing/storing it. i aint bothered please say if its wrong i wanna learn more if you are on about mine ? Link to comment
Scooby Posted September 29, 2007 Share Posted September 29, 2007 yeah i did mean urs, i didnt realise there were more above it untill now. i clicked a link from an email last night and i only saw urs... of course now i can see there are a few.. urs looks fine apart from that one small bug on line 4. Link to comment
Recommended Posts