mIRC Home    About    Download    Register    News    Help

Print Thread
J
JohanDerksen
JohanDerksen
J
Dunno if the title is clear to everyone... smile

What I want to do...
1) People can msg in query a number to me in a special format. Like /msg Johan-Derksen mypassword 124121
2) My script must grab this number and put it in a list...
3) More people with different passwords can gimme such numbers... Each with a max of one, when a new number is added, the old one will be replaced...
4) When people press !id, they will see the full list of numbers with the right username ...

Example:
Person1 has password hello and sends me 12412 by /msg Johan-Derksen hello 12412
Person 2 has password goodbye and sends me 632632 by /msg Johan-Derksen goodbye 632632

The script makes a list...
And when some one presses !id or so, they will see:
Person1: 12412
Person2: 632632


it would be extremely great if the list is delete at monday morning or so...
Are there some heroes who can sort this out? Thanx!!! laugh

Joined: Mar 2004
Posts: 175
R
Vogon poet
Offline
Vogon poet
R
Joined: Mar 2004
Posts: 175
This is a rough idea of how to do it, I'm not sure if the "clear list on Monday" function works though.
Code:
On *:TEXT:mypassword &:?: {
If ($2 isnum) { writeini -n Passwordlist.ini Passwords $Nick $2 }
}
On *:TEXT:!ID:?: { play -tPasswords $Nick Passwordlist.ini }
On *:START: {
If ($Day == Monday) {
If (!%Passwordclear) {
remini Passwordlist.ini Passwords
set %Passwordclear Yes
}
}
Else { unset %Passwordclear }
}

J
JohanDerksen
JohanDerksen
J
I am not sure I understand your code.
Do I have to make an own file called Passwordlist.ini?
And how can I place the password in it? It should be in a way it can be understanded by the script..

I am not sure I fully understand your post smile
Could you please help me a bit moren?

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534

;This event checks if someone Private Messages you with 'mypassword' and then goes on to check if $2 (the second parameter isnum (a numeric value)). If it's true then a file called passwordlist.ini is created for you.


The ini configuration file will look something like
[Passwords]
JohanDerksen=12345

Code:
On *:TEXT:mypassword &:?: {
  If ($2 isnum) { writeini -n Passwordlist.ini Passwords $Nick $2 }
}


;This event checks when someone types '!ID' in a private message to you. And then displays the contents of the ini configuration file to them.

Code:
On *:TEXT:!ID:?: { 
  play -tPasswords $Nick Passwordlist.ini 
}


;This event means when mIRC is started up on your machine it checks the date for you. If the day is monday and the variable %passwordclear is null, it removes the passwordsset section from passwordlist.ini. Otherwise if %passwordclear is true it unsets the variable.

Code:
On *:START: {
  If ($Day == Monday) {
    If (!%Passwordclear) {
      remini Passwordlist.ini Passwordsset %Passwordclear Yes
    }
  }
  Else { 
    unset %Passwordclear 
  }
}


This code has nothing to do with me, I just added some comments on how the code works. As that Relinsquish said, he don't know whether or not the check day event works as it's not been tried. May I just add a little note to Relinsquish, you shouldn't post code in that hasn't been tested.

J
JohanDerksen
JohanDerksen
J
Hmmmz, I see...
The script part in which a file is deleted won't work, cause the mirc client won't be restarted but is always working.

I will test it but it looks ok smile

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Well, this should work. It worked for me.

Code:
alias chk.time {
  timerchk 0 1 if ($day == Monday) { 
    if ($exists(passwordlist.ini)) {
      remove passwordlist.ini 
      timerchk off 
    }
    else { 
      timerchk off
    }
  }
}



* Timer chk activated
* Removed 'C:\Documents and Settings\Andy\Desktop\mIRC\passwordlist.ini'
* Timer chk halted


It removed it straight away because today is 'Monday'. This script is probably too late. But you can always change the date in the above alias to another day. The timer will be in a continuous loop until it reaches the day you choose and then will check to see if you have a file called passwordlist.ini, if you have that file in $mircdir it will remove it and halt the timer, if not it will halt the timer anyway.

Here's what you should have in your remote scripts...

Code:
On *:TEXT:mypassword &:?: {
  If ($2 isnum) { writeini -n Passwordlist.ini Passwords $Nick $2 }
}

On *:TEXT:!ID:?: { 
  play -tPasswords $Nick Passwordlist.ini 
}

alias chk.time {
  timerchk 0 1 if ($day == Monday) { 
    if ($exists(passwordlist.ini)) {
      remove passwordlist.ini 
      timerchk off 
    }
    else { 
      timerchk off
    }
  }
}

J
JohanDerksen
JohanDerksen
J
Yeah thanx!
Do I understand it well?
The timer in the last script means it will only check once on a monday wether the file exist or not..
True? smile

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
It doesn't check once it's in a continuous loop. So if you was to type it now if the file exists it will delete it and stop the timer. If it don't exist it will just stop the timer. If you was to type it tomorrow, it'd remove the file a week from today, Monday the 3rd of January. As today is already Monday, if you type the command now it'd check if the file exists now, do you understand me? Sorry for not being more clearert.

Last edited by SladeKraven; 27/12/04 01:49 PM.
J
JohanDerksen
JohanDerksen
J
Yeah ok, that far I understand...
But now..

When the script knows it is monday and it has deleted the file... does it turn on again the next monday? Does it start checking then again?

PS
I joined your irc server but you were not there :P

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Ah right, well. It'd stop the timer on Monday and delete the file and halt the timer till you have typed /chk.time on the Tuesday.

PS. I'm back on Yucafe.


Link Copied to Clipboard