Jump to content

wildcards in conditional statements


jtr
 Share

Recommended Posts

I searched "wildcard*" (heh) and could not find the answer to my question. I want to make this work with wildcards:

Select

Case $torrent = "Naruto*"

Send($naruto &"{ENTER}")

WinWaitActive("BitTorrent Files for [dattebayo] Anime")

Case $torrent = "One Piece*"

Send($onepiece &"{ENTER}")

WinWaitActive("Kaizoku-Fansubs - BitTorrent")

Case $torrent <> "zzzz"

Send("http://www.animesuki.com{ENTER}")

WinWaitActive("BitTorrent @ AnimeSuki.com")

Sleep(3000)

EndSelect

But when I type something like Naruto 120, it goes to animesuki.com. I tried ?'s .'s and *'s. Please can someone provide me with the answers that I so seek. :lmao:o:):):):):whistle::huh2:

Link to comment
Share on other sites

Wildcards are not supported in conditional statements.

This is the closest thing.

Select
   Case StringLeft($torrent, 6) = "Naruto" OR StringInStr($torrent, "Naruto")
      Send($naruto &"{ENTER}")
      WinWaitActive("BitTorrent Files for [dattebayo] Anime")
   
   Case StringLeft($torrent, 9) = "One Piece" OR StringInStr($torrent, "One Piece")   
      Send($onepiece &"{ENTER}")
      WinWaitActive("Kaizoku-Fansubs - BitTorrent")
      
   Case $torrent <> "zzzz"
      Send("http://www.animesuki.com{ENTER}")
      WinWaitActive("BitTorrent @ AnimeSuki.com")
      Sleep(3000)

EndSelect
Edited by SlimShady
Link to comment
Share on other sites

You'll need to do something with the string functions. It all depends on what you want exactly, have a look at the functions and decide which will work best for your situation.

Here is a little bit that will help in the meantime

Replace this:

Case $torrent = "Naruto*"

With this:

Case StringInStr($torrent, "Naruto")

This will work more like "*Naruto*" though.

Er.. damn I typed too slow. And then I didn't even realize it until now! Hehe.

Edited by Saunders
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...