Jump to content

Recommended Posts

Posted (edited)

Updated.

Goodbye ImageShack and hello Imgur !

_ ImageShack upload method has changed and can't get it working.

_Pics urls are now not always accepted by some websites because extension is not at the end of url.

_animated gifs are still not supported.

3 reasons for change for another Image Uploader : Imgur.com

and to celebrate it, i put a new skin but i keep the little frog, now she's green ! :D

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

  • 2 weeks later...
Posted

Hey wakillon,

i have used you tinyuploader programm quite a time now. It was very handy until i noticed that uploading didnt worked.

I downloaded the new version but neither the au3 in the forum, nor the au3 or the exe from googlecode doesnt work.

When i try to drag a picture onto the frog, the programm chashes.

Only exception is when i run the au3 file under x64, then this error message appeares:

An error occured !
Picture analysis has not suceeded.

Im on Win7 64bit

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Posted

  On 7/12/2012 at 3:13 PM, 'qsek said:

Hey wakillon,

i have used you tinyuploader programm quite a time now. It was very handy until i noticed that uploading didnt worked.

I downloaded the new version but neither the au3 in the forum, nor the au3 or the exe from googlecode doesnt work.

When i try to drag a picture onto the frog, the programm chashes.

Only exception is when i run the au3 file under x64, then this error message appeares:

An error occured !
Picture analysis has not suceeded.

Im on Win7 64bit

I'm temporarily on 64 bit today and you are right : on 64 bit curl doesn't return infos correctly.

Leave me a bit of time to find the error ;)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

  • 5 weeks later...
Posted

  Reveal hidden contents

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(38,40) : ERROR: $READ_CONTROL previously declared as a 'Const'.

Global Const $READ_CONTROL = 0x00020000

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(39,37) : ERROR: $WRITE_DAC previously declared as a 'Const'.

Global Const $WRITE_DAC = 0x00040000

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(40,39) : ERROR: $WRITE_OWNER previously declared as a 'Const'.

Global Const $WRITE_OWNER = 0x00080000

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(41,39) : ERROR: $SYNCHRONIZE previously declared as a 'Const'.

Global Const $SYNCHRONIZE = 0x00100000

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(44,106) : ERROR: $STANDARD_RIGHTS_ALL previously declared as a 'Const'.

Global Const $STANDARD_RIGHTS_ALL = BitOR($DELETE, $READ_CONTROL, $SYNCHRONIZE, $WRITE_DAC, $WRITE_OWNER)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(45,54) : ERROR: $STANDARD_RIGHTS_EXECUTE previously declared as a 'Const'.

Global Const $STANDARD_RIGHTS_EXECUTE = $READ_CONTROL

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(46,51) : ERROR: $STANDARD_RIGHTS_READ previously declared as a 'Const'.

Global Const $STANDARD_RIGHTS_READ = $READ_CONTROL

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(47,97) : ERROR: $STANDARD_RIGHTS_REQUIRED previously declared as a 'Const'.

Global Const $STANDARD_RIGHTS_REQUIRED = BitOR($DELETE, $READ_CONTROL, $WRITE_DAC, $WRITE_OWNER)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(48,52) : ERROR: $STANDARD_RIGHTS_WRITE previously declared as a 'Const'.

Global Const $STANDARD_RIGHTS_WRITE = $READ_CONTROL

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(185,42) : ERROR: $WM_QUERYENDSESSION previously declared as a 'Const'.

Global Const $WM_QUERYENDSESSION = 0x0011

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(187,36) : ERROR: $WM_QUERYOPEN previously declared as a 'Const'.

Global Const $WM_QUERYOPEN = 0x0013

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(190,37) : ERROR: $WM_ENDSESSION previously declared as a 'Const'.

Global Const $WM_ENDSESSION = 0x0016

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(194,40) : ERROR: $WM_SETTINGCHANGE previously declared as a 'Const'.

Global Const $WM_SETTINGCHANGE = 0x001A

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(291,40) : ERROR: $WM_NCXBUTTONDOWN previously declared as a 'Const'.

Global Const $WM_NCXBUTTONDOWN = 0x00AB

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(292,38) : ERROR: $WM_NCXBUTTONUP previously declared as a 'Const'.

Global Const $WM_NCXBUTTONUP = 0x00AC

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(293,42) : ERROR: $WM_NCXBUTTONDBLCLK previously declared as a 'Const'.

Global Const $WM_NCXBUTTONDBLCLK = 0x00AD

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(307,34) : ERROR: $WM_UNICHAR previously declared as a 'Const'.

Global Const $WM_UNICHAR = 0x0109

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(311,47) : ERROR: $WM_IME_STARTCOMPOSITION previously declared as a 'Const'.

Global Const $WM_IME_STARTCOMPOSITION = 0x010D

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(312,45) : ERROR: $WM_IME_ENDCOMPOSITION previously declared as a 'Const'.

Global Const $WM_IME_ENDCOMPOSITION = 0x010E

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(313,42) : ERROR: $WM_IME_COMPOSITION previously declared as a 'Const'.

Global Const $WM_IME_COMPOSITION = 0x010F

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(352,40) : ERROR: $WM_RBUTTONDBLCLK previously declared as a 'Const'.

Global Const $WM_RBUTTONDBLCLK = 0x0206

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(355,40) : ERROR: $WM_MBUTTONDBLCLK previously declared as a 'Const'.

Global Const $WM_MBUTTONDBLCLK = 0x0209

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(361,39) : ERROR: $WM_PARENTNOTIFY previously declared as a 'Const'.

Global Const $WM_PARENTNOTIFY = 0x0210

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(362,40) : ERROR: $WM_ENTERMENULOOP previously declared as a 'Const'.

Global Const $WM_ENTERMENULOOP = 0x0211

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(363,39) : ERROR: $WM_EXITMENULOOP previously declared as a 'Const'.

Global Const $WM_EXITMENULOOP = 0x0212

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(364,35) : ERROR: $WM_NEXTMENU previously declared as a 'Const'.

Global Const $WM_NEXTMENU = 0x0213

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(366,41) : ERROR: $WM_CAPTURECHANGED previously declared as a 'Const'.

Global Const $WM_CAPTURECHANGED = 0x0215

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(367,33) : ERROR: $WM_MOVING previously declared as a 'Const'.

Global Const $WM_MOVING = 0x0216

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(368,41) : ERROR: $WM_POWERBROADCAST previously declared as a 'Const'.

Global Const $WM_POWERBROADCAST = 0x0218

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(369,39) : ERROR: $WM_DEVICECHANGE previously declared as a 'Const'.

Global Const $WM_DEVICECHANGE = 0x0219

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(370,36) : ERROR: $WM_MDICREATE previously declared as a 'Const'.

Global Const $WM_MDICREATE = 0x0220

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(371,37) : ERROR: $WM_MDIDESTROY previously declared as a 'Const'.

Global Const $WM_MDIDESTROY = 0x0221

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(372,38) : ERROR: $WM_MDIACTIVATE previously declared as a 'Const'.

Global Const $WM_MDIACTIVATE = 0x0222

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(373,37) : ERROR: $WM_MDIRESTORE previously declared as a 'Const'.

Global Const $WM_MDIRESTORE = 0x0223

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(374,34) : ERROR: $WM_MDINEXT previously declared as a 'Const'.

Global Const $WM_MDINEXT = 0x0224

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(375,38) : ERROR: $WM_MDIMAXIMIZE previously declared as a 'Const'.

Global Const $WM_MDIMAXIMIZE = 0x0225

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(376,34) : ERROR: $WM_MDITILE previously declared as a 'Const'.

Global Const $WM_MDITILE = 0x0226

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(377,37) : ERROR: $WM_MDICASCADE previously declared as a 'Const'.

Global Const $WM_MDICASCADE = 0x0227

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(378,41) : ERROR: $WM_MDIICONARRANGE previously declared as a 'Const'.

Global Const $WM_MDIICONARRANGE = 0x0228

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(379,39) : ERROR: $WM_MDIGETACTIVE previously declared as a 'Const'.

Global Const $WM_MDIGETACTIVE = 0x0229

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(386,37) : ERROR: $WM_MDISETMENU previously declared as a 'Const'.

Global Const $WM_MDISETMENU = 0x0230

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(387,40) : ERROR: $WM_ENTERSIZEMOVE previously declared as a 'Const'.

Global Const $WM_ENTERSIZEMOVE = 0x0231

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(388,39) : ERROR: $WM_EXITSIZEMOVE previously declared as a 'Const'.

Global Const $WM_EXITSIZEMOVE = 0x0232

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(389,36) : ERROR: $WM_DROPFILES previously declared as a 'Const'.

Global Const $WM_DROPFILES = 0x0233

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(390,41) : ERROR: $WM_MDIREFRESHMENU previously declared as a 'Const'.

Global Const $WM_MDIREFRESHMENU = 0x0234

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(392,41) : ERROR: $WM_IME_SETCONTEXT previously declared as a 'Const'.

Global Const $WM_IME_SETCONTEXT = 0x0281

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(393,37) : ERROR: $WM_IME_NOTIFY previously declared as a 'Const'.

Global Const $WM_IME_NOTIFY = 0x0282

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(394,38) : ERROR: $WM_IME_CONTROL previously declared as a 'Const'.

Global Const $WM_IME_CONTROL = 0x0283

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(395,46) : ERROR: $WM_IME_COMPOSITIONFULL previously declared as a 'Const'.

Global Const $WM_IME_COMPOSITIONFULL = 0x0284

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(396,37) : ERROR: $WM_IME_SELECT previously declared as a 'Const'.

Global Const $WM_IME_SELECT = 0x0285

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(397,35) : ERROR: $WM_IME_CHAR previously declared as a 'Const'.

Global Const $WM_IME_CHAR = 0x0286

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(399,38) : ERROR: $WM_IME_REQUEST previously declared as a 'Const'.

Global Const $WM_IME_REQUEST = 0x0288

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(400,38) : ERROR: $WM_IME_KEYDOWN previously declared as a 'Const'.

Global Const $WM_IME_KEYDOWN = 0x0290

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(401,36) : ERROR: $WM_IME_KEYUP previously declared as a 'Const'.

Global Const $WM_IME_KEYUP = 0x0291

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(402,39) : ERROR: $WM_NCMOUSEHOVER previously declared as a 'Const'.

Global Const $WM_NCMOUSEHOVER = 0x02A0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(403,37) : ERROR: $WM_MOUSEHOVER previously declared as a 'Const'.

Global Const $WM_MOUSEHOVER = 0x02A1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(404,39) : ERROR: $WM_NCMOUSELEAVE previously declared as a 'Const'.

Global Const $WM_NCMOUSELEAVE = 0x02A2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(405,37) : ERROR: $WM_MOUSELEAVE previously declared as a 'Const'.

Global Const $WM_MOUSELEAVE = 0x02A3

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(406,44) : ERROR: $WM_WTSSESSION_CHANGE previously declared as a 'Const'.

Global Const $WM_WTSSESSION_CHANGE = 0x02B1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(407,39) : ERROR: $WM_TABLET_FIRST previously declared as a 'Const'.

Global Const $WM_TABLET_FIRST = 0x02C0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(408,38) : ERROR: $WM_TABLET_LAST previously declared as a 'Const'.

Global Const $WM_TABLET_LAST = 0x02DF

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(424,42) : ERROR: $WM_QUERYNEWPALETTE previously declared as a 'Const'.

Global Const $WM_QUERYNEWPALETTE = 0x030F

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(425,44) : ERROR: $WM_PALETTEISCHANGING previously declared as a 'Const'.

Global Const $WM_PALETTEISCHANGING = 0x0310

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(426,41) : ERROR: $WM_PALETTECHANGED previously declared as a 'Const'.

Global Const $WM_PALETTECHANGED = 0x0311

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(427,33) : ERROR: $WM_HOTKEY previously declared as a 'Const'.

Global Const $WM_HOTKEY = 0x0312

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(432,32) : ERROR: $WM_PRINT previously declared as a 'Const'.

Global Const $WM_PRINT = 0x0317

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(433,38) : ERROR: $WM_PRINTCLIENT previously declared as a 'Const'.

Global Const $WM_PRINTCLIENT = 0x0318

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(434,37) : ERROR: $WM_APPCOMMAND previously declared as a 'Const'.

Global Const $WM_APPCOMMAND = 0x0319

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(435,39) : ERROR: $WM_THEMECHANGED previously declared as a 'Const'.

Global Const $WM_THEMECHANGED = 0x031A

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(456,40) : ERROR: $WM_HANDHELDFIRST previously declared as a 'Const'.

Global Const $WM_HANDHELDFIRST = 0x0358

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(457,39) : ERROR: $WM_HANDHELDLAST previously declared as a 'Const'.

Global Const $WM_HANDHELDLAST = 0x035F

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(458,35) : ERROR: $WM_AFXFIRST previously declared as a 'Const'.

Global Const $WM_AFXFIRST = 0x0360

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(459,34) : ERROR: $WM_AFXLAST previously declared as a 'Const'.

Global Const $WM_AFXLAST = 0x037F

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(460,38) : ERROR: $WM_PENWINFIRST previously declared as a 'Const'.

Global Const $WM_PENWINFIRST = 0x0380

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(461,37) : ERROR: $WM_PENWINLAST previously declared as a 'Const'.

Global Const $WM_PENWINLAST = 0x038F

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1424,40) : ERROR: $LOGON_WITH_PROFILE previously declared as a 'Const'.

Global Const $LOGON_WITH_PROFILE = 0x01

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1425,47) : ERROR: $LOGON_NETCREDENTIALS_ONLY previously declared as a 'Const'.

Global Const $LOGON_NETCREDENTIALS_ONLY = 0x02

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1816,44) : ERROR: $DUPLICATE_CLOSE_SOURCE previously declared as a 'Const'.

Global Const $DUPLICATE_CLOSE_SOURCE = 0x01

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1817,43) : ERROR: $DUPLICATE_SAME_ACCESS previously declared as a 'Const'.

Global Const $DUPLICATE_SAME_ACCESS = 0x02

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1823,36) : ERROR: $SecurityAnonymous previously declared as a 'Const'.

Global Const $SecurityAnonymous = 0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1824,41) : ERROR: $SecurityIdentification previously declared as a 'Const'.

Global Const $SecurityIdentification = 1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1825,40) : ERROR: $SecurityImpersonation previously declared as a 'Const'.

Global Const $SecurityImpersonation = 2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1826,37) : ERROR: $SecurityDelegation previously declared as a 'Const'.

Global Const $SecurityDelegation = 3

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1828,31) : ERROR: $TokenPrimary previously declared as a 'Const'.

Global Const $TokenPrimary = 1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(1829,37) : ERROR: $TokenImpersonation previously declared as a 'Const'.

Global Const $TokenImpersonation = 2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(2582,38) : ERROR: $TMPF_FIXED_PITCH previously declared as a 'Const'.

Global Const $TMPF_FIXED_PITCH = 0x01

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(2583,33) : ERROR: $TMPF_VECTOR previously declared as a 'Const'.

Global Const $TMPF_VECTOR = 0x02

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(2584,35) : ERROR: $TMPF_TRUETYPE previously declared as a 'Const'.

Global Const $TMPF_TRUETYPE = 0x04

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(2585,33) : ERROR: $TMPF_DEVICE previously declared as a 'Const'.

Global Const $TMPF_DEVICE = 0x08

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(3354,55) : ERROR: $TOKEN_EXECUTE previously declared as a 'Const'.

Global Const $TOKEN_EXECUTE = $STANDARD_RIGHTS_EXECUTE

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(3358,70) : ERROR: $TOKEN_READ previously declared as a 'Const'.

Global Const $TOKEN_READ = BitOR($STANDARD_RIGHTS_READ, $TOKEN_QUERY)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(3359,129) : ERROR: $TOKEN_WRITE previously declared as a 'Const'.

Global Const $TOKEN_WRITE = BitOR($STANDARD_RIGHTS_WRITE, $TOKEN_ADJUST_DEFAULT, $TOKEN_ADJUST_GROUPS, $TOKEN_ADJUST_PRIVILEGES)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\APIConstants.au3(3360,274) : ERROR: $TOKEN_ALL_ACCESS previously declared as a 'Const'.

Global Const $TOKEN_ALL_ACCESS = BitOR($STANDARD_RIGHTS_REQUIRED, $TOKEN_ADJUST_DEFAULT, $TOKEN_ADJUST_GROUPS, $TOKEN_ADJUST_PRIVILEGES, $TOKEN_ADJUST_SESSIONID, $TOKEN_ASSIGN_PRIMARY, $TOKEN_DUPLICATE, $TOKEN_EXECUTE, $TOKEN_IMPERSONATE, $TOKEN_QUERY, $TOKEN_QUERY_SOURCE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\WinAPIEx.au3(1044,399) : ERROR: $tagTEXTMETRIC previously declared as a 'Const'.

Global Const $tagTEXTMETRIC = 'long tmHeight;long tmAscent;long tmDescent;long tmInternalLeading;long tmExternalLeading;long tmAveCharWidth;long tmMaxCharWidth;long tmWeight;long tmOverhang;long tmDigitizedAspectX;long tmDigitizedAspectY;wchar tmFirstChar;wchar tmLastChar;wchar tmDefaultChar;wchar tmBreakChar;byte tmItalic;byte tmUnderlined;byte tmStruckOut;byte tmPitchAndFamily;byte tmCharSet;'

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\WinAPIEx.au3(8108,104) : ERROR: _WinAPI_DuplicateHandle() already defined.

Func _WinAPI_DuplicateHandle($hProcess, $hSource, $hTarget, $iAccess = 0, $iOptions = 2, $fInherit = 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Include\WinAPIEx.au3(18069,34) : ERROR: _WinAPI_GetTextMetrics() already defined.

Func _WinAPI_GetTextMetrics($hDC)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersOneDownloadsTinyPicCaptureUploader v 1.0.2.9.au3 - 96 error(s), 0 warning(s)

C:UsersOneDownloadsTinyPicCaptureUploader v 1.0.2.9.au3 - 96 error(s), 0 warning(s)

  • 9 months later...
  • 3 weeks later...
Posted

I have forgot a small precision which is important,  the photo dragged on the Logo isn't modified at all.

A copy is made, and the script works only on it, and a new copy is created at each modification you want apply.

So don't worry for your photos. ^_^

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

  • 1 month later...
Posted

When I run both the source and the exe on Windows 7 with autoit latest beta, the window slides up at the lower right and continues to slide up to the top of the screen where it stays off screen.  When I try to capture it with my mouse and drag it to the middle the window jumps back to it's previous location and continues to float off screen.

Posted
  On 8/13/2013 at 2:48 PM, jaberwocky6669 said:

Version 1.0.3.4?  If so then I have already.  Same issue.

 

oh! it's strange, we use it at home (large family) on xpsp3, win7 x86 and x64 without problems...

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Posted (edited)

Ah, I see why.  I have my task bar on the left hand side of my screen.  WHen I place it back at the bottom then it works fine.

Edit: I've been looking for a program like this that doesn't have all of the cruft so I think I will use this from now on.  Thanks!

Edited by jaberwocky6669
Posted
  On 8/13/2013 at 4:02 PM, jaberwocky6669 said:

Ah, I see why.  I have my task bar on the left hand side of my screen.  WHen I place it back at the bottom then it works fine.

Edit: I've been looking for a program like this that doesn't have all of the cruft so I think I will use this from now on.  Thanks!

 

Glad you get it working now !  :)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

  • 4 weeks later...
Posted (edited)

Hello,
I am trying to automate imageshack in one of my latest projects and the imageshack api is making my life difficult lately.
I can't seem to provide the key correctly.

I am getting this error:

<links>
<error id="auth_error">You must provide a valid auth token or dev key. see http://code.google.com/p/imageshackapi/</error>
</links>

I copied your functions to see if it will work and the error I get is still the same. imageshack api doesn't seem to accept the key

This is what I tried

#include <Array.au3>
#include <WinHTTP.au3>
Global $sBoundary
Global $sImageShackApiKey = '09DILMRX7e36454a055ba7752db96e58b2b6a589'

$sFile = "large.png"
$sPicPath = $sFile
$sBoundary = '--' & _GenerateBoundary ( 30 )
_HostImageShackUpload($sPicPath)
If @error Then ConsoleWrite(@error & @LF)
 
Func _HostImageShackExtractLinks ( $XmlData )
 Local $aImageShackChars[11] = ['image_link', 'image_html', 'image_bb', 'image_bb2', 'thumb_link', 'thumb_html', 'thumb_bb', 'thumb_bb2', 'yfrog_link', 'yfrog_thumb', 'is_link' ]
 Local $aLinks[11]
 For $i = 0 To UBound ( $aLinks ) -1
  $aLinks[$i] = StringRegExpReplace ( $XmlData, '(?is).*<(' & $aImageShackChars[$i] & ')>(.*?)</\1>.*', '\2' )
 Next
 _ArrayDelete ( $aLinks, 1 )
 _ArrayDelete ( $aLinks, 1 )
 _ArrayDelete ( $aLinks, 1 )
 $aLinks[2] = StringReplace ( $aLinks[2], '&lt;', '<' )
 $aLinks[2] = StringReplace ( $aLinks[2], '&gt;', '>' )
 $aLinks[2] = StringReplace ( $aLinks[2], '&quot;', '"' )
 ReDim $aLinks[4]
 If UBound ( $aLinks ) > 2 Then
  If $aLinks[UBound ( $aLinks )-1] <> '' Then
   If StringLeft ( $aLinks[1], 5 ) <> 'http:' Then $aLinks[1]=''
   Return $aLinks
  Else
   Return SetError ( 3 )
  EndIf
 Else
  Return SetError ( 1 )
 EndIf
EndFunc ;==> _HostImageShackExtractLinks ()
Func _HostImageShackSetDataToSend ( $sPicPath )
 Local $sData = _PicReadData ( $sPicPath )
 If @error Then Return SetError ( 1 )
 Local $sImageName = _GetFullNameByFullPath ( $sPicPath )
 If @error Or $sImageName = '' Then Return SetError ( 2 )
 Local $sCdfdn = 'Content-Disposition: form-data; name'
 Local $sCtaos = 'Content-Type: application/octet-stream'
 Return SetError ( 0, '', $sBoundary & @CRLF & _
  $sCdfdn & '="Filename"' & @CRLF & @CRLF & $sImageName & @CRLF & $sBoundary & @CRLF & _
  $sCdfdn & '="new_flash_uploader"' & @CRLF & @CRLF & 'y' & @CRLF & $sBoundary & @CRLF & _
  $sCdfdn & '="key"' & @CRLF & @CRLF & $sImageShackApiKey & @CRLF & $sBoundary & @CRLF & _
  $sCdfdn & '="optimage"' & @CRLF & @CRLF & '0' & @CRLF & $sBoundary & @CRLF & _
  $sCdfdn & '="swfupload"' & @CRLF & @CRLF & '1' & @CRLF & $sBoundary & @CRLF & _
  $sCdfdn & '="optsize"' & @CRLF & @CRLF & '0' & @CRLF & $sBoundary & @CRLF & _
  $sCdfdn & '="Filedata"; filename="' & $sImageName & '"' & @CRLF & _
  $sCtaos & @CRLF & @CRLF & $sData & @CRLF & $sBoundary & @CRLF & _
  $sCdfdn & '="Upload"' & @CRLF & @CRLF & _
  'Submit Query' & @CRLF & $sBoundary ) ;& '--' )
EndFunc ;==> _HostImageShackSetDataToSend ()
Func _HostImageShackUpload ( $sPicPath )
 Local $hOpen, $hConnect, $hRequest, $sHost, $sDataToSend, $sReceivedData, $iError, $sResponse, $sPostData, $sContentType
 $sHost = "load.imageshack.us" ; can be also "iload1.imageshack.us" to "iload10.imageshack.us"  "my.imageshack.us"  "post.imageshack.us"  "reg.imageshack.us"  "register.imageshack.us"
 $hOpen = _WinHttpOpen ( 'Shockwave Flash' )
 If @error Then
  SetError ( 1 )
 Else
  $hConnect = _WinHttpConnect ( $hOpen, $sHost )
  If @error Then
   SetError ( 2 )
  Else
   $hRequest = _WinHttpOpenRequest ( $hConnect, 'POST', '/upload_api.php', 'HTTP/1.1' )
   If @error Then
    SetError ( 3 )
   Else
    _WinHttpSetTimeouts ( $hRequest, 10000, 60000, 90000, 90000 )
    $sDataToSend = _HostImageShackSetDataToSend ( $sPicPath )
    $sContentType = 'Content-Type: multipart/form-data; boundary=' & StringTrimLeft ( $sBoundary, 2 )
    _WinHttpSendRequest ( $hRequest, $sContentType, $WINHTTP_NO_REQUEST_DATA, StringLen ( $sDataToSend ) )
    If @error Then
     SetError ( 4 )
    Else
     _PicUploadProgress ( $hRequest, $sPicPath, $sDataToSend )
     If Not @error Then
      $hTimerInit = TimerInit ()
      _WinHttpReceiveResponse ( $hRequest )
      If @error Then
       SetError ( 5 )
      Else
       If _WinHttpQueryDataAvailable ( $hRequest ) Then
        $sReceivedData = ''
        While 1
         $sReceivedData &= _WinHttpReadData ( $hRequest )
         If Not @extended Then
          SetError ( 0 )
          ExitLoop
         EndIf
        WEnd
        If StringInStr ( $sReceivedData, 'error' ) Then
         ConsoleWrite($sReceivedData & @LF)
         SetError ( 6 )
        EndIf
       Else
        SetError ( 7 )
       EndIf
      EndIf
     Else
      SetError ( 8 )
     EndIf
    EndIf
   EndIf
  EndIf
 EndIf
 $iError = @error
 If $hRequest Then _WinHttpCloseHandle ( $hRequest )
 If $hConnect Then _WinHttpCloseHandle ( $hConnect )
 If $hOpen Then _WinHttpCloseHandle ( $hOpen )
 Return SetError ( $iError, 0, $sReceivedData )
EndFunc ;==> _HostImageShackUpload ()
Func _PicReadData ( $sPicPath )
 If Not FileExists ( $sPicPath ) Then Return SetError ( -1 )
 Local $hFile = FileOpen ( $sPicPath )
 If $hFile = -1 Then Return SetError ( 1 )
 Local $sData = FileRead ( $hFile )
 If @error Then Return SetError ( 2 )
 FileClose ( $hFile )
 Return $sData
EndFunc ;==> _PicReadData ()

Func _GetFullNameByFullPath ( $sFullPath )
 Local $aFileName = StringSplit ( $sFullPath, '\' )
 If Not @error Then Return $aFileName[$aFileName[0]]
 Return SetError ( 1 )
EndFunc ;==> _GetFullNameByFullPath

Func _PicUploadProgress ( $hRequest, $sPicPath, $sDataToSend )
 If Not FileExists ( $sPicPath ) Then Return SetError ( -1 )
 Local $sDatas = StringToBinary ( $sDataToSend )
 Local $iNumberOfBytesToSend = 2048 ; 1024; 2048; 8192
 Local $Bin, $iPercent, $iStart = 1, $iExtended = 0
 While 1
  $Bin = BinaryMid ( $sDatas, $iStart, $iNumberOfBytesToSend )
  If BinaryLen ( $Bin ) = 0 Then Return
  _WinHTTPWriteData ( $hRequest, $Bin, 1 )
  If Not @error Then
   $iExtended += @extended
   $iPercent =  Round ( ( $iExtended  ) / ( StringLen ( $sDataToSend ) ) * 100, 2 )
   If $iPercent > 97 Then $iPercent = 97
   $iStart += $iNumberOfBytesToSend
  Else
   $Bin = 0
   Return SetError ( 1 )
  EndIf
 WEnd
EndFunc ;==> _PicUploadProgress ()

Func _GenerateBoundary ( $iLen )
 Local $sString = ''
 Do
  Switch Random ( 1, 3, 1 )
   Case 1
    $sString &= Chr ( Random ( 48, 57, 1 ) )  ; 0 to 9
   Case 2
    $sString &= Chr ( Random ( 65, 90, 1 ) )  ; A to Z
   Case 3
    $sString &= Chr ( Random ( 97, 122, 1 ) ) ; a to z
  EndSwitch
 Until StringLen ( $sString ) = $iLen
 Return $sString
EndFunc ;==> _GenerateBoundary ()

Seens the error is 6 I added a consolewrite so you can see it for youself aswell.
Do you know what is wrong here?
I got another key btw.

 

Edited by AutID
Posted

AutID, I have try this way with your ApiKey, and it works fine...

Do you use the last WinHttp.au3 version ?

#include <Array.au3>
#include <WinHTTP.au3>

Global $sBoundary
Global $sImageShackApiKey = '09DILMRX7e36454a055ba7752db96e58b2b6a589'

$sFile = @ScriptDir '\MyPicture.jpg"
$sPicPath = $sFile
$sBoundary = '--' & _GenerateBoundary ( 30 )
$sData = _HostImageShackUpload($sPicPath)
If @error Then ConsoleWrite(@error & @LF)
ConsoleWrite ( '$sData : ' & $sData & @Crlf )
$aLinks = _HostImageShackExtractLinks ( $sData )
If @error Then ConsoleWrite(@error & @LF)
_ArrayDisplay ( $aLinks )

Func _HostImageShackExtractLinks ( $XmlData )
    Local $aImageShackChars[11] = ['image_link', 'image_html', 'image_bb', 'image_bb2', 'thumb_link', 'thumb_html', 'thumb_bb', 'thumb_bb2', 'yfrog_link', 'yfrog_thumb', 'is_link' ]
    Local $aLinks[11]
    For $i = 0 To UBound ( $aLinks ) -1
        $aLinks[$i] = StringRegExpReplace ( $XmlData, '(?is).*<(' & $aImageShackChars[$i] & ')>(.*?)</\1>.*', '\2' )
    Next
    _ArrayDelete ( $aLinks, 1 )
    _ArrayDelete ( $aLinks, 1 )
    _ArrayDelete ( $aLinks, 1 )
    $aLinks[2] = StringReplace ( $aLinks[2], '&lt;', '<' )
    $aLinks[2] = StringReplace ( $aLinks[2], '&gt;', '>' )
    $aLinks[2] = StringReplace ( $aLinks[2], '&quot;', '"' )
    ReDim $aLinks[4]
    If UBound ( $aLinks ) > 2 Then
        If $aLinks[UBound ( $aLinks )-1] <> '' Then
            If StringLeft ( $aLinks[1], 5 ) <> 'http:' Then $aLinks[1]=''
            Return $aLinks
        Else
            Return SetError ( 3 )
        EndIf
    Else
        Return SetError ( 1 )
    EndIf
EndFunc ;==> _HostImageShackExtractLinks ()

Func _HostImageShackSetDataToSend ( $sPicPath )
    Local $sData = _PicReadData ( $sPicPath )
    If @error Then Return SetError ( 1 )
    Local $sImageName = _GetFullNameByFullPath ( $sPicPath )
    If @error Or $sImageName = '' Then Return SetError ( 2 )
    Local $sCdfdn = 'Content-Disposition: form-data; name'
    Local $sCtaos = 'Content-Type: application/octet-stream'
    Return SetError ( 0, '', $sBoundary & @CRLF & _
        $sCdfdn & '="Filename"' & @CRLF & @CRLF & $sImageName & @CRLF & $sBoundary & @CRLF & _
        $sCdfdn & '="new_flash_uploader"' & @CRLF & @CRLF & 'y' & @CRLF & $sBoundary & @CRLF & _
        $sCdfdn & '="key"' & @CRLF & @CRLF & $sImageShackApiKey & @CRLF & $sBoundary & @CRLF & _
        $sCdfdn & '="optimage"' & @CRLF & @CRLF & '0' & @CRLF & $sBoundary & @CRLF & _
        $sCdfdn & '="swfupload"' & @CRLF & @CRLF & '1' & @CRLF & $sBoundary & @CRLF & _
        $sCdfdn & '="optsize"' & @CRLF & @CRLF & '0' & @CRLF & $sBoundary & @CRLF & _
        $sCdfdn & '="Filedata"; filename="' & $sImageName & '"' & @CRLF & _
        $sCtaos & @CRLF & @CRLF & $sData & @CRLF & $sBoundary & @CRLF & _
        $sCdfdn & '="Upload"' & @CRLF & @CRLF & _
        'Submit Query' & @CRLF & $sBoundary ) ;& '--' )
EndFunc ;==> _HostImageShackSetDataToSend ()

Func _HostImageShackUpload ( $sPicPath )
    Local $hOpen, $hConnect, $hRequest, $sHost, $sDataToSend, $sReceivedData, $iError, $sResponse, $sPostData, $sContentType
    $sHost = "load.imageshack.us" ; can be also "iload1.imageshack.us" to "iload10.imageshack.us"  "my.imageshack.us"  "post.imageshack.us"  "reg.imageshack.us"  "register.imageshack.us"
    $hOpen = _WinHttpOpen ( 'Shockwave Flash' )
    If @error Then
        SetError ( 1 )
    Else
        $hConnect = _WinHttpConnect ( $hOpen, $sHost )
        If @error Then
            SetError ( 2 )
        Else
            $hRequest = _WinHttpOpenRequest ( $hConnect, 'POST', '/upload_api.php', 'HTTP/1.1' )
            If @error Then
                SetError ( 3 )
            Else
                _WinHttpSetTimeouts ( $hRequest, 10000, 60000, 90000, 90000 )
                $sDataToSend = _HostImageShackSetDataToSend ( $sPicPath )
                $sContentType = 'Content-Type: multipart/form-data; boundary=' & StringTrimLeft ( $sBoundary, 2 )
                _WinHttpSendRequest ( $hRequest, $sContentType, $WINHTTP_NO_REQUEST_DATA, StringLen ( $sDataToSend ) )
                If @error Then
                    SetError ( 4 )
                Else
                    _PicUploadProgress ( $hRequest, $sPicPath, $sDataToSend )
                    If Not @error Then
                        $hTimerInit = TimerInit ()
                        _WinHttpReceiveResponse ( $hRequest )
                        If @error Then
                            SetError ( 5 )
                        Else
                            If _WinHttpQueryDataAvailable ( $hRequest ) Then
                                $sReceivedData = ''
                                While 1
                                    $sReceivedData &= _WinHttpReadData ( $hRequest )
                                    If Not @extended Then
                                        SetError ( 0 )
                                        ExitLoop
                                    EndIf
                                WEnd
                                If StringInStr ( $sReceivedData, 'error' ) Then
                                    ConsoleWrite($sReceivedData & @LF)
                                    SetError ( 6 )
                                EndIf
                            Else
                                SetError ( 7 )
                            EndIf
                        EndIf
                    Else
                        SetError ( 8 )
                    EndIf
                EndIf
            EndIf
        EndIf
    EndIf
    $iError = @error
    If $hRequest Then _WinHttpCloseHandle ( $hRequest )
    If $hConnect Then _WinHttpCloseHandle ( $hConnect )
    If $hOpen Then _WinHttpCloseHandle ( $hOpen )
    Return SetError ( $iError, 0, $sReceivedData )
EndFunc ;==> _HostImageShackUpload ()

Func _PicReadData ( $sPicPath )
    If Not FileExists ( $sPicPath ) Then Return SetError ( -1 )
    Local $hFile = FileOpen ( $sPicPath )
    If $hFile = -1 Then Return SetError ( 1 )
    Local $sData = FileRead ( $hFile )
    If @error Then Return SetError ( 2 )
    FileClose ( $hFile )
    Return $sData
EndFunc ;==> _PicReadData ()

Func _GetFullNameByFullPath ( $sFullPath )
    Local $aFileName = StringSplit ( $sFullPath, '\' )
    If Not @error Then Return $aFileName[$aFileName[0]]
    Return SetError ( 1 )
EndFunc ;==> _GetFullNameByFullPath

Func _PicUploadProgress ( $hRequest, $sPicPath, $sDataToSend )
    If Not FileExists ( $sPicPath ) Then Return SetError ( -1 )
    Local $sDatas = StringToBinary ( $sDataToSend )
    Local $iNumberOfBytesToSend = 2048 ; 1024; 2048; 8192
    Local $Bin, $iPercent, $iStart = 1, $iExtended = 0
    While 1
        $Bin = BinaryMid ( $sDatas, $iStart, $iNumberOfBytesToSend )
        If BinaryLen ( $Bin ) = 0 Then Return
        _WinHTTPWriteData ( $hRequest, $Bin, 1 )
        If Not @error Then
            $iExtended += @extended
            $iPercent =  Round ( ( $iExtended  ) / ( StringLen ( $sDataToSend ) ) * 100, 2 )
            If $iPercent > 97 Then $iPercent = 97
            $iStart += $iNumberOfBytesToSend
        Else
            $Bin = 0
            Return SetError ( 1 )
        EndIf
    WEnd
EndFunc ;==> _PicUploadProgress ()

Func _GenerateBoundary ( $iLen )
    Local $sString = ''
    Do
        Switch Random ( 1, 3, 1 )
            Case 1
                $sString &= Chr ( Random ( 48, 57, 1 ) )  ; 0 to 9
            Case 2
                $sString &= Chr ( Random ( 65, 90, 1 ) )  ; A to Z
            Case 3
                $sString &= Chr ( Random ( 97, 122, 1 ) ) ; a to z
        EndSwitch
    Until StringLen ( $sString ) = $iLen
    Return $sString
EndFunc ;==> _GenerateBoundary ()

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Posted

It was me doing something wrong. Apparently I had copied the script and I forgot to declare the right path of the image.
It is working like a charm. Thanks.
An other question I would like to ask, how can I store the link of the image in a var. It is displayed in an array with 4 other link. Only the 1st I need.
 

Posted

  On 9/5/2013 at 12:51 PM, AutID said:

It was me doing something wrong. Apparently I had copied the script and I forgot to declare the right path of the image.

It is working like a charm. Thanks.

An other question I would like to ask, how can I store the link of the image in a var. It is displayed in an array with 4 other link. Only the 1st I need.

 

 

Ok, so you can get link like this : $sYourStringLink = $aLinks[0] 

:)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Posted
  On 9/5/2013 at 12:57 PM, wakillon said:

Ok, so you can get link like this : $sYourStringLink = $aLinks[0] 

:)

Yes it should be like that but unfortunately the $aLinks[0] doesn't return something. The msgbox doesn't even appears. Consolewrite neither, that's why I am asking...

Something's weird here...

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
×
×
  • Create New...