If Captcha is found..

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

If Captcha is found..

by DogHollywood on Mon Mar 27, 2017 5:24 pm

Hey

I don't know how to do it..

I want my Macro to automaticly Enter the Captcha via 9kw.eu when an Captcha is being found
The Game is "https://www.dsrpg.uk"
Another problem right now is to download the Captcha, there is also a Captcha at the Register, its the same as ingame
" <img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image"> "
The Captcha will happen like every 2000 Battle
The Code I have

Code: Select all
VERSION BUILD=9030808 RECORDER=FX
SET !ERRORIGNORE YES

FRAME NAME="main"
TAG POS=1 TYPE=BUTTON ATTR=TXT:Fight
WAIT SECONDS=5


The Captcha - If you click on the Image..
"TAG POS=1 TYPE=IMG ATTR=ID:captcha"

The Captcha is downloadable via rightclick and download, and the downloaded file is 100% the Captcha shown on Screen
The Random Captcha's can be found on https://www.dsrpg.uk/securimage/securimage_show.php its 3-6 numbers
So it has to be uploaded into 9kw.eu's Website and then it has to automaticly enter the Number

Code: Select all
FRAME NAME="main"
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:necropolis.php?action=pass ATTR=NAME:captcha_code CONTENT=NUMBERS123456


It's just for Battling in that Game, I want to change it so it automaticly Fills out the Captcha via 9kw.eu when an Captcha was found
DogHollywood
 
Posts: 1
Joined: Mon Mar 27, 2017 4:53 pm

Re: If Captcha is found..

by thecoder2012 on Wed Jun 14, 2017 1:01 am

DogHollywood wrote:I don't know how to do it..

Short example with your captcha, 9kw and main page:

Code: Select all
VERSION BUILD=8820413
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE NO
SET !TIMEOUT_PAGE 999
SET !TIMEOUT_STEP 999
TAB CLOSEALLOTHERS
'
' This imacros script created by 9kw.eu
' Find more here: http://www.9kw.eu/
'
' Note for users with firefox with the message "Firefox prevented this page from automatically reloading.":
' UNCHECK the option "warn me when pages try to redirect" in your browser
' You find the checkbox under Options > Advanced > General > Accessibility

' Path to the captcha image with timestamp
' Tempfolder like C:\ or C:\TEMP under windows or like /tmp under linux (optional)
SET !VAR0 D:\
' Tempfile
SET !VAR1 captcha_{{!NOW:yyyymmdd_hhnnss}}.jpg

' Step 1: Config for 9kw.eu for your apikey
SET !VAR2 your_api_key

'And priority (prio 1-20)
SET !VAR3 0

' Step 2: Save the captcha picture to local disk
TAB T=1
URL GOTO=https://www.dsrpg.uk/
WAIT SECONDS=3
ONDOWNLOAD FOLDER={{!VAR0}} FILE={{!VAR1}} WAIT=YES
TAG POS=1 TYPE=IMG ATTR=ID:captcha CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT

'Wait a random number (1 to 5) of seconds
SET !VAR9 EVAL("Math.floor(Math.random()*5 + 1);")
WAIT SECONDS={{!VAR9}}

'Syntaxcheck: API Key, prio
SET !VAR2 EVAL("var s=\"{{!VAR2}}\"; if(s.match(/^[a-zA-Z0-9]+$/) && s.length <= 50 && s.length >= 5) s; else MacroError(\"API Key is wrong.\")")
SET !VAR3 EVAL("var s=\"{{!VAR3}}\", d = parseFloat(s); if(d >= 0 && d <= 20) d; else MacroError(\"Value(Prio) is not in the set range.\")")

'Step 3: Open the a new tab, and go to 9kw.eu, and submit the captcha picture
TAB OPEN
TAB T=2
URL GOTO=http://www.9kw.eu/grafik/form.html
'The apikey is used to identify each of our customers, which you can get from the our page. It is assigned to the CONTENT.
TAG POS=1 TYPE=INPUT ATTR=NAME:apikey CONTENT={{!VAR2}}
'Priority in our system like min. 0 to max. 20 (cost +0-20)
TAG POS=1 TYPE=INPUT ATTR=NAME:prio CONTENT={{!VAR3}}
'Options for the form. See more under http://www.9kw.eu/grafik/form.html and http://www.9kw.eu/api.html
TAG POS=1 TYPE=INPUT ATTR=NAME:source CONTENT=imacros
'The path of the captcha picture saved is assigned to the CONTENT
TAG POS=1 TYPE=INPUT ATTR=NAME:file-upload-01 CONTENT={{!VAR0}}{{!VAR1}}
'Submit the formdata to 9kw.eu
TAG POS=1 TYPE=INPUT ATTR=TYPE:submit
'Extract the captchaid from your captcha submit
TAG POS=1 TYPE=INPUT ATTR=NAME:captchaid EXTRACT=TXT
SET !VAR5 {{!EXTRACT}}
'Clean the !EXTRACT variable for the next task
SET !EXTRACT NULL
'Extract the characters that are recoginzed from the picture of captcha.
TAG POS=1 TYPE=INPUT ATTR=NAME:result EXTRACT=TXT
TAB CLOSE
TAB T=1

'Display extracted data (only for debug)
'PROMPT {{!VAR5}}

'Step 4: Check the captcha answer (text or nothing like #EANF# = EXTRACT ANCHOR NOT FOUND)
SET !VAR6 EVAL("if (\"{{!EXTRACT}}\" == \"#EANF#\") {var x = \"\";} else {var x = \"{{!EXTRACT}}\";} x;")
'Clean the !EXTRACT variable for the next task
SET !EXTRACT NULL

'Step 5: Fill the recognized characters to the verification box
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:signupform ATTR=NAME:captcha_code CONTENT={{!VAR6}}
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:signupform ATTR=*
WAIT SECONDS=2

'Cleanup: Delete the old captcha picture
FILEDELETE NAME={{!VAR0}}{{!VAR1}}


DogHollywood wrote:It's just for Battling in that Game, I want to change it so it automaticly Fills out the Captcha via 9kw.eu when an Captcha was found

You can use javascript with iMacros 8.9.7 for if and other commands.
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
User avatar
thecoder2012
 
Posts: 91
Joined: Sat Aug 15, 2015 10:14 am
Location: Internet


Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 5 guests

-->