-
Posts
29 -
Joined
-
Last visited
Reputation Activity
-
Marcelos reacted to sakamoto in Telegram Bot UDF
LinkOut, thanks for the answer.
I figured out the buttons, but get an error when receiving callback_data.
Other methods "url" "switch_inline_query" work out well.
#include "Telegram UDF.au3" $ikeyb = '{"inline_keyboard":[[{"text":"Button 1","callback_data":"data 1"}]]}' _InitBot("xxxIDxxx","xxxTOKENxxx") While 1 $msgData = _Polling() If $msgData <> '' Then ConsoleWrite($msgData[0]&'|'&$msgData[1]&'|'&$msgData[2]&'|'&$msgData[3]&@LF) Switch $msgData[3] Case '777' _SendMsg($msgData[2], 'Message', Default, $ikeyb) EndSwitch WEnd Telegram UDF.au3" (481) $dataArray[2] = $tmpChatID[3] $dataArray[2] = ^ ERROR
-
Marcelos reacted to LinkOut in Telegram Bot UDF
Thank you for using it! To use inline_keyboard first you have to create an array of array of button (sound bad, I know) and then add this (encoded in json format) to the query. I'm working on it but only in php for the moment. If this can help you:
$keyboard = array("inline_keyboard" => array(array(array("text" => "ButtonText", "callback_data" => "CallbackText"),array("text" => "ButtonText2", "callback_data" => "CallbackText2")))); $keyboard = json_encode($keyboard, true); And after send it as:
http://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=12345678&text=test&reply_markup=$keyboard
-
Marcelos reacted to sakamoto in Telegram Bot UDF
Thanks a lot for UDF. Someone else can give an example of inline_keyboard?
-
Marcelos reacted to junkew in YAMM Yet Another Move Mouse application
I assume you do this to keep your computer not getting locked
another trick vbscript is to numlock on/off not converted to AutoIT code (I assume if mousemove gets blocked by policy its just a matter of time they block other tools) so far never seen getting wscript locked out by policy
' Function to prevent locking the screen Function BlinkNumlock() Dim WxhShell Set WxhShell = CreateObject("WScript.Shell") WxhShell.SendKeys "{NUMLOCK}" WxhShell.SendKeys "{NUMLOCK}" Set WxhShell = Nothing End Function
-
Marcelos reacted to TheDcoder in Tutorial: Complete walkthrough for joining AutoIt's IRC Channel using a desktop client
I have updated the tutorial to match with freenode's current infrastructure
-
Marcelos reacted to BrewManNH in SciTE Toolbar
I have tried everything I could think of to get it to go lower, but it won't go below 5% for some reason.
EDIT: Seems like, but I'm not positive, that it might be related to using ProcessExists to monitor for SciTE.
-
Marcelos reacted to blackandwhite in Add toolbar icons to SciTe editor
Hello all!
is it possible to add new toolbar icons like run/build/compile to SciTE4AutoIt (by editing config, properties files etc..) except using additional scripts or tools?
And will these features be included/added in next releases?
-
Marcelos reacted to BrewManNH in Add toolbar icons to SciTe editor
You can't just add toolbar buttons to the SciTE window, you'd have to rewrite the program and recompile it to do that. There are toolbars for SciTE that use AutoIt, one of which I updated a few years back. If you open the hidden contents in my signature, there's a link to the toolbar in there.
-
Marcelos reacted to Helge in Opening a file with default application...
Run(@comspec & ' /c start ' & $file, '', @SW_HIDE) -
-
Marcelos reacted to water in Open Excel File on Desktop?
Or
#include <Excel.au3> Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, "C:\Users\TEaston\Desktop\Abacus List.xls")
-
Marcelos reacted to lNoVal in FileOpenDialog and SQLite Error
Hi Guys,
first of all i wanna thank you for this greate forum. I am a autoit newbie and leaned allready a lot (i belive) by reading this forum.
Now i got to a strange problem.
If i open a FileOpenDialoge befor using my sqlite connection. SQL will not find the DB table. (See first script)
But if i comment the FileDialog it works fine and i get the result of my DB Table.
Where is the mistake?
Thx for your help.
#include <Array.au3> #include <SQLite.au3> #include <SQLite.dll.au3> local $sMessage local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\" , "All (*.*)") global $sSQliteDll = _SQLite_Startup("SQLite3.dll") If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!" & @CRLF & @CRLF & _ "Not FOUND in @SystemDir, @WindowsDir, @ScriptDir, @WorkingDir or from www.autoitscript.com") Exit -1 EndIf local $DB_Main_MainDB = _SQLite_Open("Main_DB.db3") Local $hQuery,$aRow local $sql = "SELECT * FROM testscript" _SQLite_Query($DB_Main_MainDB, $sql,$hQuery) dim $test While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK $test = $arow[0] wEnd msgbox (0,0,$test) #include <Array.au3> #include <SQLite.au3> #include <SQLite.dll.au3> local $sMessage ;-------------------------------------------------------------------------------------------- ;local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\" , "All (*.*)") ;----------------------------------------------------------------------------------------- global $sSQliteDll = _SQLite_Startup("SQLite3.dll") If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!" & @CRLF & @CRLF & _ "Not FOUND in @SystemDir, @WindowsDir, @ScriptDir, @WorkingDir or from www.autoitscript.com") Exit -1 EndIf local $DB_Main_MainDB = _SQLite_Open("Main_DB.db3") Local $hQuery,$aRow local $sql = "SELECT * FROM testscript" _SQLite_Query($DB_Main_MainDB, $sql,$hQuery) dim $test While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK $test = $arow[0] wEnd msgbox (0,0,$test) -
Marcelos reacted to Melba23 in FileOpenDialog and SQLite Error
lNoVal,
This line merely sets the @WorkingDir to its current content and so is completely superfluous: >
FileChangeDir(@WorkingDir) What you need to do is something like this:
Local $sWorkingDir = @WorkingDir ; Save current WorkingDir in a variable Global $glb_MAIN_DBname = $sWorkingDir & "\Main_DB.db3" local $sMessage local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\" , "All (*.*)") ; WorkingDir will now be changed FileChangeDir($sWorkingDir) ; So reset WorkingDir to the original saved path All clear?
M23
-
Marcelos reacted to Melba23 in Does anyone know how to customize the scite output color scheme?
ivan,
As far as I know these are the only coloured SciTE console lines:
ConsoleWrite('! = Bold Red' & @LF) ConsoleWrite('> = Blue' & @LF) ConsoleWrite('- = Orange' & @LF) ConsoleWrite('+ = Green' & @LF) ConsoleWrite('(5) : = Red (jump to line 5 when double-clicked)' & @LF) ConsoleWrite('Start with String or Integer then ' & @TAB & '6' & ' = Pink (jump to line 6 when double-clicked)' & @LF) ConsoleWrite('(' & @ScriptLineNumber & ') : = Red (jump to line ' & @ScriptLineNumber & ' when double-clicked)' & @CRLF) M23
-
Marcelos reacted to lNoVal in FileOpenDialog and SQLite Error
Melba23 your the best
Here is the working code if someone has the same Problem..
#include <Array.au3> #include <SQLite.au3> #include <SQLite.dll.au3> Global $glb_MAIN_DBname = @WorkingDir&"\Main_DB.db3" local $sMessage local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\" , "All (*.*)") FileChangeDir(@WorkingDir) global $sSQliteDll = _SQLite_Startup("SQLite3.dll") If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!" & @CRLF & @CRLF & _ "Not FOUND in @SystemDir, @WindowsDir, @ScriptDir, @WorkingDir or from www.autoitscript.com") Exit -1 EndIf ;msgbox(0,0,$glb_MAIN_DBname) local $DB_Main_MainDB = _SQLite_Open($glb_MAIN_DBname) Local $hQuery,$aRow local $sql = "SELECT * FROM amis_testcasescript" _SQLite_Query($DB_Main_MainDB, $sql,$hQuery) dim $test While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK $test = $arow[0] wEnd msgbox (0,0,$test) -
Marcelos reacted to Melba23 in FileOpenDialog and SQLite Error
lNoVal,
A successful return from FileOpenDialog resets the @WorkingDir to the path of the returned file. I imagine that the _SQLite_Open cannot then find the database file as it is looking in the wrong place. >
Try passing the full path, or reset the path with FileChangeDir.
M23
Edit: And welcome to the AutoIt forums.
-
-
Marcelos reacted to MrCreatoR in Get the file name and the file directory from a file path
Nope:
Dim $szDrive, $szDir, $szFName, $szExt _PathSplit(@ScriptFullPath, $szDrive, $szDir, $szFName, $szExt) ConsoleWrite($szDrive & $szDir & @LF)
Then here is a simple way for your functions:
Func GetDir($sFilePath) If Not IsString($sFilePath) Then Return SetError(1, 0, -1) EndIf Local $FileDir = StringRegExpReplace($sFilePath, "\\[^\\]*$", "") Return $FileDir EndFunc Func GetFileName($sFilePath) If Not IsString($sFilePath) Then Return SetError(1, 0, -1) EndIf Local $FileName = StringRegExpReplace($sFilePath, "^.*\\", "") Return $FileName EndFunc -
Marcelos reacted to Rofellos in Get the file name and the file directory from a file path
Yes, thanks!
-
Marcelos reacted to TheDcoder in [DcoderBot] An IRC Bot Base for AutoIt
Hello! , How are we doing today? I am guessing we all are doing fine . Lets get to the point, the reason why I created this bot (base) is that ##AutoIt needs a bot too! ##c has a bot made in C, ##haskell has a bot made in haskell etc... It would not be good if we don't have a bot for ourselves! , Thus I created this bot base (I nick named it DcoderBot).
I could create a Feature list here but I already made one in the GitHub page, so I won't do it now, If you want to see the features list, please refer to this link!
Download
GitHub
https://github.com/TheDcoder/IRC-Bot-Base-for-AutoIt
Thanks and enjoy!
-
Marcelos reacted to TheDcoder in GUI made with ISN AutoIt Studio not showing icons
Here is the code:
#include-once ; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ; #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> ShellExecute(@DesktopDir & '\test.txt', Default, Default, "open") Global $test = GUICreate("test",124,108,-1,-1,-1,-1) GUISetBkColor(0xFFFFFF,$test) GUICtrlCreateButton("Hell No",12,12,100,30,128,-1) GUICtrlSetImage(-1, @DesktopDir & '\12.ico') GUICtrlCreateButton("Hell Yeah",12,60,100,30,128,-1) GUICtrlSetImage(-1, @DesktopDir & '\11.ico') GUISetState(@SW_SHOW,$test) Note that the icons are not being displayed, how can I get them to display icon?
Thanks in advance, TD
11.ico
12.ico
-
Marcelos got a reaction from TheDcoder in Tutorial: Complete walkthrough for joining AutoIt's IRC Channel using a desktop client
Awesome idea
also the use of the hexchat , it is cool.
see you there.. ##Autoit
-
Marcelos reacted to Gianni in Problem with color
just insert a delay right after that line,
use the Sleep() function with the wanted delay
Sleep(1000) delays 1 second, Sleep(500) delays half second ...
Local $iTargetColor = 0xFF0000 ; the wanted color Do $var = PixelGetColor(212, 157) If $var <> $iTargetColor Then MouseClick("primary", 755, 618) ; not the right color Sleep(1000) ; delay of 1000 milliseconds (that is 1 second) Until $var = $iTargetColor ; repeat this loop until color is the wanted one MouseClick("primary", 300, 300) ; click here and go ahead...
Local $iTargetColor = 0xFF0000 ; the wanted color While 1 $var = PixelGetColor(212, 157) If $var = $iTargetColor Then MouseClick("primary", 300, 300) ; click here... ExitLoop ; and go ahead... (exit the While - Wend loop) Else MouseClick("primary", 755, 618) ; not the right color Sleep(1000) ; delay of 1000 milliseconds (that is 1 second) EndIf WEnd ; repeat this loop until color is the wanted one
-
Marcelos reacted to Melba23 in Listview Auto ScrollDown
DeSwa,
Then you need to use _GUICtrlListView_EnsureVisible with the index of the new item.
M23
-
Marcelos reacted to Bowmore in Progress bar issue when embedded inside a status bar
A better solution - re-embed on receipt of WM_PAINT message
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <Timers.au3> #include <GuiStatusBar.au3> #include <ProgressConstants.au3> Opt("MustDeclareVars", 1) Global $iMemo, $hStatusBar, $progress, $percent = 0, $direction = 1 _Example_CallBack() Func _Example_CallBack() Local $hGUI, $iTimerProgress, $btn_change, $iWait = 10, $btn_state Local $aParts[3] = [75, 330, -1] $hGUI = GUICreate("Timers Using CallBack Function(s)", 400, 320) $iMemo = GUICtrlCreateEdit("", 2, 32, 396, 226, BitOR($WS_HSCROLL, $WS_VSCROLL)) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $btn_state = GUICtrlCreateButton("Start Progress Bar", 70, 270, 100, 25) $btn_change = GUICtrlCreateButton("Change", 215, 270, 90, 25) GUICtrlSetState($btn_change, $GUI_DISABLE) $hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aParts) _GUICtrlStatusBar_SetText($hStatusBar, "Timers") _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) GUICtrlSetColor($progress, 0xff0000) _GUICtrlStatusBar_EmbedControl($hStatusBar, 1, GUICtrlGetHandle($progress)) GUISetState() GUIRegisterMsg($WM_PAINT, "_WM_PAINT") _Timer_SetTimer($hGUI, 1000, "_UpdateStatusBarClock") ; create timer While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_state If GUICtrlRead($btn_state) = "Start Progress Bar" Then $iTimerProgress = _Timer_SetTimer($hGUI, $iWait, "_UpdateProgressBar") ; create timer If @error Or $iTimerProgress = 0 Then ContinueLoop GUICtrlSetData($btn_state, "Stop Progress Bar") GUICtrlSetState($btn_change, $GUI_ENABLE) Else GUICtrlSetState($btn_change, $GUI_DISABLE) _Timer_KillTimer($hGUI, $iTimerProgress) GUICtrlSetData($btn_state, "Start Progress Bar") EndIf Case $btn_change If $iWait = 10 Then $iWait = 250 Else $iWait = 10 EndIf MemoWrite("Timer for _UpdateProgressBar set at: " & $iWait & " milliseconds") $iTimerProgress = _Timer_SetTimer($hGUI, $iWait, "", $iTimerProgress) ; reuse timer with different interval EndSwitch WEnd ConsoleWrite("Killed All Timers? " & _Timer_KillAllTimers($hGUI) & @CRLF) GUIDelete() EndFunc ;==>_Example_CallBack ; call back function Func _UpdateStatusBarClock($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) EndFunc ;==>_UpdateStatusBarClock ; call back function Func _UpdateProgressBar($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime $percent += 5 * $direction GUICtrlSetData($progress, $percent) If $percent = 100 Or $percent = 0 Then $direction *= -1 If $percent = 100 Then GUICtrlSetColor($progress, 0xff0000) ElseIf $percent = 0 Then GUICtrlSetColor($progress, 0x0000ff) EndIf EndFunc ;==>_UpdateProgressBar ; Write a line to the memo control Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite Func _WM_PAINT($hWnd, $Msg) _GUICtrlStatusBar_EmbedControl($hStatusBar, 1, GUICtrlGetHandle($progress)) Return 'GUI_RUNDEFMSG' EndFunc ;==>WM_PAINT