Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED][Jhyton] Sikuli Tolong - Aku sangkut :(
21-05-2012, 04:57 PM, (This post was last modified: 22-05-2012, 01:00 PM by HaoRen.)
Post: #1
[SOLVED][Jhyton] Sikuli Tolong - Aku sangkut :(
First of all, aku total beginner bab Jhyton. Zero. Aku kena buat unit testing skang ni.

Condition
1. Aku nak pilih player dari list (belah kanan)
2. Tapi aku kena tick jersey atas padang dulu, baru boleh pilih.
3. Loop (atau tak kisah cara apa) sampai semua 11 player siap.

[Image: 0ca57659.png]

Masalah
1. Tak stable. Aku dah berjaya pick player randomly dari list tapi kadang2 dia tak habis pick mouse click tempat lain. Mouse gila agaknya GayFace
2. Case bila dah lengkap 11 player, dia still tak tekan button save. -.-

Code aku:
Code:
import os

find(Pattern("ManageTeam.png").targetOffset(2,-8))
click(getLastMatch())
wait(10) #wait time for all players to load
type(Key.PAGE_DOWN)

for shirt in findAll("kolar.png"):
    ctr = 0
    while ctr < 11:
        click(shirt)
        wait(5)
        click(Pattern("playerlist.PNG").targetOffset(-150,-2))
        if exists(Pattern("overbudget.png").targetOffset(71,43)):
            click(getLastMatch())
            continue
        ctr = ctr + 1
        if ctr > 10:
            break
    break
find(Pattern("save.png").targetOffset(5,0))
click(getLastMatch())
wait(3)
find(Pattern("acceptsave.PNG").targetOffset(3,0))
click(getLastMatch)
exit()
[Image: 2819320332_zps3a75fe14.png]
[Image: 8df84e84.gif]

22-05-2012, 12:58 PM,
Post: #2
RE: [Jhyton] Sikuli Tolong - Aku sangkut :(
Nevermind, aku dah berjaya figure out solution dia. Mod dah boleh close GayFace

Code:
import os
find("ManageTeam.png")
click(getLastMatch())
wait(5) #wait time for all players to load
type(Key.PAGE_DOWN)

for x in range(0, 11):
    if exists("collar.png"):
        click("collar.png")
        wait(3)
        click(Pattern("playerlist.png").targetOffset(-166,0))
find("save.png")
click(getLastMatch())
wait(3)
find("acceptsave.PNG")
click(getLastMatch())
exit()
[Image: 2819320332_zps3a75fe14.png]
[Image: 8df84e84.gif]



Possibly Related Threads...
Thread Author Replies Views Last Post
  Minta Tolong.. Elize 6 837 09-03-2012, 05:40 PM
Last Post: d0lph1n

Forum Jump: