mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
Hello,

So I'm trying to make a slap command which will read several words that the targeted person can be slapped by.

The problem is that I've saved a txt doc in /scripts, as an .txt file.
When I open the file it contains this:
http://gyazo.com/5265387889561dec73581e5475a8ebfe

And I've wrote in my remote script like this:
Code:
on 1:text:slap:#artiiz:{
  msg $chan slap $nick with $read(slap.txt)
}


But it just says this:
http://gyazo.com/befa4aa20903e932845b8d32be5802d1

What do I have to do, to make the $read command read the whole file?

Appreciate all the help!

Best Regards
Artiiz

Joined: May 2010
Posts: 29
P
Ameglian cow
Offline
Ameglian cow
P
Joined: May 2010
Posts: 29
Originally Posted By: Artiiz
Hello,

So I'm trying to make a slap command which will read several words that the targeted person can be slapped by.

The problem is that I've saved a txt doc in /scripts, as an .txt file.
When I open the file it contains this:
http://gyazo.com/5265387889561dec73581e5475a8ebfe

And I've wrote in my remote script like this:
Code:
on 1:text:slap:#artiiz:{
  msg $chan slap $nick with $read(slap.txt)
}


But it just says this:
http://gyazo.com/befa4aa20903e932845b8d32be5802d1

What do I have to do, to make the $read command read the whole file?

Appreciate all the help!

Best Regards
Artiiz


It appears you have created a file with mIRC script editor (for slap.txt) instead of creating the file outright with a text editor. I assume that the file isnt actually named slap.txt and is probably something like slap.txt.ini. The file contents is also incorrect (because of how you created it) you should create a new TEXT file and put each item you want to slap with on a new line.

If you wanted to be able to edit the file for convenience sake with the mIRC editor you can easily do something like:

Code:
on 1:TEXT:slap:#artiiz:{
    var %items an elephant,an object,a fish,a car

    msg $chan slap $nick with $gettok(%items,$rand(1,$numtok(%items,44)),44)
}

Instead of storing the slap objects in an external file.

Also if you want the slap to show up like a /me you can use /describe $chan instead of /msg $chan.

Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
Ahh okay.

So if I go into the AppData/Roaming/mIRC/scripts in my computer, and makes an text file and just writes everything in there, and saves it, it should work?
Or do I need to save it on another place than /scripts?


Also, in the code you've wrote:

Code:
on 1:TEXT:slap:#artiiz:{
    var %items an elephant,an object,a fish,a car

    msg $chan slap $nick with $gettok(%items,$rand(1,$numtok(%items,44)),44)
}

Is it possible to make it to pick random, and not count from first to last?
I appreciate the help, I'm kinda new in this area and therefore don't understand so much xD

Joined: May 2010
Posts: 29
P
Ameglian cow
Offline
Ameglian cow
P
Joined: May 2010
Posts: 29
Originally Posted By: Artiiz
Ahh okay.

So if I go into the AppData/Roaming/mIRC/scripts in my computer, and makes an text file and just writes everything in there, and saves it, it should work?
Or do I need to save it on another place than /scripts?


Also, in the code you've wrote:

Code:
on 1:TEXT:slap:#artiiz:{
    var %items an elephant,an object,a fish,a car

    msg $chan slap $nick with $gettok(%items,$rand(1,$numtok(%items,44)),44)
}

Is it possible to make it to pick random, and not count from first to last?
I appreciate the help, I'm kinda new in this area and therefore don't understand so much xD


To note, the script I posted does select a random item from the list in the variable (If you would like me to explain what its doing in more detail I can!)

But yeah I dont believe it would be in your scripts directory, it should be in the folder up from that, but to make completely sure you have the directory you want the file in use:

Code:
//echo -a $mircdir


(With the double slash) Into any mIRC window with a text box and it will give you the directory you'll want to place your files into.

Last edited by Plornt; 29/07/15 12:08 PM.
Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
I made it work now smile

Thank you so much for the help, really appreciated! <3


Link Copied to Clipboard