mIRC Home    About    Download    Register    News    Help

Print Thread
Just a little help for a script request #244044 19/01/14 09:15 PM
Joined: Jun 2013
Posts: 6
H
helen2 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Jun 2013
Posts: 6
I would like to ask u a help oon how to make a script/addon taht will permit me to receivea request wrainting in a txt file and with a remote command to reade this file and at the end olso to delate it so taht will be created a new one with new request.I supose that allmost the question is to menage the write/reade comamnd but realy dont have any clue how to do taht.Can u haelp me?
Thank's
Helen

Re: Just a little help for a script request [Re: helen2] #244126 25/01/14 09:37 AM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Hey

Try this.....

!request Request e.g !request This is just a test
!deleterequests - Deletes all requests made
!showrequests - Shows any requests made

I have made them as room commands but can be changed to private message trigger.

Let me know how it works.

Code:
on *:text:*:#: { 
  if ($strip($1) == !request) { 
    if ($2 == $null) { .notice $nick Please enter a request. To do a request do !request Request | halt }
    else {
      .notice $nick sending your request: $2-
      .write Requests.txt $nick requested $2- ( $date at $time )

    }
  }
  if ($strip($1) == !showrequests)  { 
    if ($exists(Requests.txt) == $false) { .notice $nick No requests have been made | halt }
    else {
      .timer 1 2 .play -n $nick Requests.txt 
    } 
  }
  if ($strip($1) == !deleterequests) { 
    if ($exists(Requests.txt) == $false) { .notice $nick There are no requests to delete! | halt }
    else {
      .notice $nick Deleting requests.....
      .remove -b Requests.txt 
      .timer 1 3 .notice $nick requests have been deleted.
    } 
  }


Regards

JayStew