mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Question about a trading script #237065 13/04/12 04:09 AM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
I'm using a trade script to transfer files between 2 FTP servers. Part of it is as follows:

Quote:
if (720p.HDTV.x264-MOMENTUM isin $2) && (provide isin $5) {
var %section = TV
var %rl = $2
var %sourcename = site1
var %sourcedir = /tv-x264/
var %curryname = site2
var %currydir = /tv-x264/



Now, the problem is that on site1 the %rl = $2 is picking up a release including the 'TV+' part as the irc string is as follows:

TV+The.First.48.S12E10.720p.HDTV.x264-MOMENTUM

So when the release name is picked up, it looks for the complete string, not just the actual release name: The.First.48.S12E10.720p.HDTV.x264-MOMENTUM

How do I tell the script to ignore the 'TV+' part in the var %rl = $2 variable?

Re: Question about a trading script [Re: sandygws] #237066 13/04/12 04:56 AM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
$replace(%rl,TV+,$null)

Re: Question about a trading script [Re: ProoN] #237067 13/04/12 04:59 AM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Thanks ProoN,

Do I just replace

var %rl = $2

with

$replace(%rl,TV+,$null)?

Re: Question about a trading script [Re: sandygws] #237068 13/04/12 05:08 AM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
Quote:

if (720p.HDTV.x264-MOMENTUM isin $2) && (provide isin $5) {
var %section = TV
var %rl = $replace($2,TV+,$null)
var %sourcename = site1
var %sourcedir = /tv-x264/
var %curryname = site2
var %currydir = /tv-x264/


Apologies. Try that.

Last edited by ProoN; 13/04/12 05:13 AM.
Re: Question about a trading script [Re: ProoN] #237069 13/04/12 05:13 AM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Thanks!

Now to wait and see if it works smile


Grrr .. it's actually TV+/

So I guess var %rl = $replace($2,TV+/,$null) is correct?


Last edited by sandygws; 13/04/12 05:18 AM.
Re: Question about a trading script [Re: sandygws] #237070 13/04/12 05:21 AM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
You could try that, although I personally try to avoid using slashes or commas within an identifier. I've found that it sometimes makes things sketchy. I, instead, generally use the $chr equivalent, ie

Quote:

if (720p.HDTV.x264-MOMENTUM isin $2) && (provide isin $5) {
var %section = TV
var %rl = $replace($2,TV+ $+ $chr(47),$null)
var %sourcename = site1
var %sourcedir = /tv-x264/
var %curryname = site2
var %currydir = /tv-x264/


See if that works.

Re: Question about a trading script [Re: ProoN] #237071 13/04/12 05:42 AM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Even better, thanks.

Also, taking these releases as an example:

The.First.48.S12E10.720p.HDTV.x264-MOMENTUM
The.First.48.S12.Update.Special.05.HDTV.x264-MOMENTUM


How do I ignore the '720p' release if I'm using

Quote:
if (HDTV.x264-MOMENTUM isin $2) && (provide isin $5) {


and only trade HDTV.x264-MOMENTUM?

smile

Re: Question about a trading script [Re: sandygws] #237072 13/04/12 05:49 AM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
Are you implying there are two results you're trying to get the script to distinguish between?

Quote:

while (*720p* !iswm %rl) { ... }

where within the brackets, { and } are where you'd execute the command, of course

Damn, constantly editing this. Trying to make it more generic rather than specific to those single titles

Last edited by ProoN; 13/04/12 06:00 AM.
Re: Question about a trading script [Re: ProoN] #237085 13/04/12 02:02 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Yes, the two examples are both HDTV, but one is standard HDTV, the other 720p HDTV.

Quote:
HDTV.x264-MOMENTUM isin $2


The problem is that the above will match 720p.HDTV.x264-MOMENTUM and HDTV.x264-MOMENTUM

So how I would tell the script to ignore the 720p bit where necessary?

Re: Question about a trading script [Re: sandygws] #237088 13/04/12 03:30 PM
Joined: Jan 2004
Posts: 1,323
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,323
Code:
... && (720p !isin %text)

Re: Question about a trading script [Re: Loki12583] #237091 13/04/12 04:50 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Thanks Loki

Quote:
(720p.HDTV.x264-MOMENTUM isin $2) && (720p !isin %text) {


Would trade

The.First.48.S12.Update.Special.05.HDTV.x264-MOMENTUM

but skip

The.First.48.S12E10.720p.HDTV.x264-MOMENTUM

... right?


Re: Question about a trading script [Re: sandygws] #237095 13/04/12 11:07 PM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
Quote:
if (*The.First.48.S12*HDTV.x264-MOMENTUM* iswm $2) && (*720p* !iswm $2) && (provide isin $5) {
var %section = TV
var %rl = $replace($2,TV+ $+ $chr(47),$null)
var %sourcename = site1
var %sourcedir = /tv-x264/
var %curryname = site2
var %currydir = /tv-x264/

Last edited by ProoN; 13/04/12 11:09 PM.
Re: Question about a trading script [Re: ProoN] #237096 13/04/12 11:17 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Nice and tidy ProoN, thanks

To confirm: that will NOT trade 720p, right?

ie line 3 ignores the 720p part?

Re: Question about a trading script [Re: sandygws] #237097 13/04/12 11:23 PM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
(*720p* !iswm $2) is what ignores the 720p part. That little bit checks to see if "720p" ISN'T in the $2, and if it isn't, continues on with the code.

Line 3 replaces the TV+/ with "$null" (or .. nothing, essentially) and sets THAT result to %rl. Could have easily just used $remove, but eh, there are many ways to accomplish the same thing. Hopefully that works, though

Re: Question about a trading script [Re: ProoN] #237098 13/04/12 11:34 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Very nice indeed. Just waiting to see if it works!

One question though: which version is correct:

Quote:
if (*HDTV.x264-MOMENTUM* iswm $2) && (*720p* !iswm $2)


or

Quote:
if (*720p.HDTV.x264-MOMENTUM* iswm $2) && (*720p* !iswm $2)


smile

Last edited by sandygws; 13/04/12 11:36 PM.
Re: Question about a trading script [Re: sandygws] #237100 13/04/12 11:47 PM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
Well, if you want it to check for only the HDTV.x264-MOMENTUM part, it'd be

Quote:
if (*HDTV.x264-MOMENTUM* iswm $2) && (*720p* !iswm $2) && (provide isin $5) {
var %section = TV
var %rl = $replace($2,TV+ $+ $chr(47),$null)
var %sourcename = site1
var %sourcedir = /tv-x264/
var %curryname = site2
var %currydir = /tv-x264/


But if you wanted it to check for both HDTV.x264-MOMENTUM and the The.First.48.S12 parts, it'd be

Quote:
if (*The.First.48.S12*HDTV.x264-MOMENTUM* iswm $2) && (*720p* !iswm $2) && (provide isin $5) {
var %section = TV
var %rl = $replace($2,TV+ $+ $chr(47),$null)
var %sourcename = site1
var %sourcedir = /tv-x264/
var %curryname = site2
var %currydir = /tv-x264/


Neither of those will do anything if 720p is anywhere within the titles, which is what you're wanting.. I think. hah

Re: Question about a trading script [Re: ProoN] #237101 13/04/12 11:50 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Originally Posted By: ProoN
Well, if you want it to check for only the HDTV.x264-MOMENTUM part, it'd be


Yes, I only want it to trade HDTV.x264-MOMENTUM - and skip the 720p versions.

laugh

Quote:
Neither of those will do anything if 720p is anywhere within the titles


720p is in the titles .. that's why I want to skip it.

So the above will skip any release with 720p in the title, right?

Last edited by sandygws; 13/04/12 11:52 PM.
Re: Question about a trading script [Re: sandygws] #237102 13/04/12 11:52 PM
Joined: Nov 2004
Posts: 21
P
ProoN Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2004
Posts: 21
First one should ultimately be what you're wanting.. I think(?). But they both ignore anything with "720p" in it, yes

Last edited by ProoN; 14/04/12 12:00 AM.
Re: Question about a trading script [Re: ProoN] #237112 14/04/12 07:45 AM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
I have a further question ProoN:

Quote:
if (*HDTV.x264-MOMENTUM* iswm $2) && (*720p* !iswm $2) && (provide isin $5) {


How do I change that to match HDTV.x264-MOMENTUM anywhere in the irc announce string .. not just in 'position' $2 ?


Re: Question about a trading script [Re: sandygws] #237118 14/04/12 06:30 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: sandygws
How do I change that to match HDTV.x264-MOMENTUM anywhere in the irc announce string .. not just in 'position' $2 ?
You can indicate the token range like so:
Code:
if (*HDTV.x264-MOMENTUM* iswm $2-5)
$2-5 means $2, $3, $4, and $5, respectively.

Page 1 of 2 1 2