mIRC Home    About    Download    Register    News    Help

Print Thread
Need help for an auto morning, afterno, night mess #267683 05/09/20 08:53 AM
Joined: Sep 2020
Posts: 5
O
OpaRob Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Sep 2020
Posts: 5
Please, who can help me with this.
PS. I am Dutch and a medium user of mIRC

Re: Need help for an auto morning, afterno, night mess [Re: OpaRob] #267684 05/09/20 10:53 AM
Joined: Feb 2015
Posts: 105
kap Offline
Vogon poet
Offline
Vogon poet
Joined: Feb 2015
Posts: 105
Dag OpaRob! Kun je uitleggen wat er aan die goedemorgen, goedemiddag, goedenavond boodschap vooraf gaat?
Wil je bijvoorbeeld dat je die boodschap uitspreekt wanneer iemand de kamer binnenkomt?

Hi OpaRob! Can you explain what precedes that good morning, good afternoon, good evening message?
For example, do you want to write that message when someone enters the channel?

Een beetje extra informatie zou tof zijn!
A little more information would be great!

Last edited by kap; 05/09/20 10:54 AM.

GNU Terry Pratchett
Re: Need help for an auto morning, afterno, night mess [Re: kap] #267685 05/09/20 11:15 AM
Joined: Sep 2020
Posts: 5
O
OpaRob Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Sep 2020
Posts: 5
Het is idd de bedoeling dat het bij binnenkomst gepost wordt, ik had wel iets gevonden maar dat werkte niet. En in welke .ini moet dit dan.komen?

It is intended that it will be posted upon arrival, I had found something but that did not work.

Like " goedemiddag $nick"

Last edited by OpaRob; 05/09/20 11:17 AM.
Re: Need help for an auto morning, afterno, night mess [Re: kap] #267686 05/09/20 11:23 AM
Joined: Sep 2020
Posts: 5
O
OpaRob Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Sep 2020
Posts: 5
Nu heb ik in remote staan " on 1:join:#:{ /msg Hoi $Nick }

En dat wil ik veranderen naar goedemorgen, middag enz. Wat op het juiste tijdstip veranderd.

Now I have in remote "on 1: join: #: {/ msg Hi $ Nick}

And I want to change that to good morning, afternoon, etc. Which changes at the right time

Re: Need help for an auto morning, afterno, night mess [Re: OpaRob] #267687 05/09/20 11:38 AM
Joined: Feb 2015
Posts: 105
kap Offline
Vogon poet
Offline
Vogon poet
Joined: Feb 2015
Posts: 105
Code
on !*:JOIN:#:{
  var %ret
  if ($time >= 00:00:00) && ($time < 06:00:00) %ret = Hey late binnenkomer! Ga lekker slapen, $nick $+ !
  elseif ($time >= 06:00:00) && ($time < 12:00:00) %ret = Goedenmorgen $nick $+ !
  elseif ($time >= 12:00:00) && ($time < 18:00:00) %ret = Goedenmiddag $nick $+ !
  elseif ($time >= 18:00:00) && ($time < 00:00:00) %ret = Goedenavond $nick $+ !
  else %ret = Iets ging fout met mijn greet script...
  msg $chan %ret
}


Je ziet, het uitroepsteken voor de JOIN statement zorgt ervoor dat deze gebeurtenis alleen plaatsvindt bij anderen (niet jezelf). Vervolgens gebruiken we IF en ELSEIF om de return value te bepalen welke naar de kamer wordt weer gegeven.

As you can see the exclamation mark before the JOIN statement makes sure the event is only fired when others JOIN (not you). Furthermore we use an IF and ELSEIF statement to set the return value which is being messaged to the channel.

Ik weet alleen niet of de operators <, > en >= kan rekenen met minuten en seconden waarden tussen de : char
I just don't know if the <, > and >= operators can calculate with minutes and second values between the : char

Last edited by kap; 05/09/20 11:41 AM.

GNU Terry Pratchett
Re: Need help for an auto morning, afterno, night mess [Re: kap] #267688 05/09/20 11:51 AM
Joined: Sep 2020
Posts: 5
O
OpaRob Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Sep 2020
Posts: 5
bedankt voor dit stukje script en ga hem testen. ik zal laten weten of het werkt

thanks for this piece of script and go test it. i will let you know if it works

Re: Need help for an auto morning, afterno, night mess [Re: kap] #267690 05/09/20 05:23 PM
Joined: Sep 2020
Posts: 5
O
OpaRob Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Sep 2020
Posts: 5
hij werkte half en na een aanpassing werkt hij nu helemaal zoals ik het wil

on !*:JOIN:#:{
var %ret
if ($time >= 00:00:00) && ($time < 05:59:59) %ret = Goedenacht $nick $+ !
elseif ($time >= 06:00:00) && ($time < 11:59:59) %ret = Goedenmorgen $nick $+ !
elseif ($time >= 12:00:00) && ($time < 17:59:59) %ret = Goedenmiddag $nick $+ !
elseif ($time >= 18:00:00) && ($time < 23:59:59) %ret = Goedenavond $nick $+ !
else %ret = Hoi $nick
msg $chan %ret
}

Re: Need help for an auto morning, afterno, night mess [Re: OpaRob] #267691 05/09/20 06:11 PM
Joined: Jan 2004
Posts: 1,385
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,385
Your tampering with kap's IF logic means that the first 4 lines will not match the times 05:59:59 11:59:59 17:59:59 23:59:59
Also, you should probably list the channels where this greetings is sent, because most large channels will not want this

Code
on !*:JOIN:#channelA,#channelB:{
  if     ($time < 06) var %ret Goedenacht
  elseif ($time < 12) var %ret Goedenmorgen
  elseif ($time < 18) var %ret Goedenmiddag
  else                var %ret Goedenavond
  msg $chan %ret $nick $+ !
}

Re: Need help for an auto morning, afterno, night mess [Re: maroon] #267693 05/09/20 09:17 PM
Joined: Feb 2003
Posts: 2,700
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,700
Code
$gettok(Goedenacht Goedenmorgen Goedenmiddag Goedenavond, $calc($calc($time) *4 //24 +1), 32)


Well. At least I won lunch.
Good philosophy, see good in bad, I like!