Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/05/2020 in all areas

  1. About AutoIt-API-WS AutoIt-API-WS is a light weight web server with expressive syntax, with the sole purpose of wrapping your existing AutoIt app with little to no effort. With AutoIt-API-WS you can send and receive data between any application or framework, as long they can handle HTTP requests, which is an industry standard today. Like my other communcations UDF AutoIt-Socket-IO AutoIt-API-WS is heavily inspired from the big boys, but this time its Laravel and Ruby on Rails. Features Highlights No external or internal dependencies required RESTful mindset when designed Expressive syntax Small codebase Heavy use of Michelsofts Dictionary object Limitations Not complient with any RFC, so something important could be missing. Time will tell! One persons slow loris attack will kill the process forever. Example of implemetnation (With screenshots) This is a basic cRud operation with the RESTful mindset in use. #include "API.au3" #include <Array.au3> _API_MGR_SetName("My APP DB adapter") _API_MGR_SetVer("1.0 BETA") _API_MGR_SetDescription("This adapter allows you to get this n that") _API_MGR_Init(3000) _API_MGR_ROUTER_GET('/users', CB_GetUsers, 'string sortBy', 'Get all users, sortBy can be either asc or desc. asc is default') _API_MGR_ROUTER_GET('/users/{id}', CB_GetUsersById, 'int id*', 'Get user by id') While _API_MGR_ROUTER_HANDLE() WEnd Func DB_GetUsers() Local $userA = ObjCreate("Scripting.Dictionary") Local $userB = ObjCreate("Scripting.Dictionary") $userA.add('id', 1) $userA.add('name', 'TarreTarreTarre') $userA.add('age', 27) $userB.add('id', 2) $userB.add('name', @UserName) $userB.add('age', 22) Local $aRet = [$userA, $userB] Return $aRet EndFunc Func CB_GetUsers(Const $oRequest) Local $aUsers = DB_GetUsers() If $oRequest.exists('sortBy') Then Switch $oRequest.item('sortBy') Case Default Case 'asc' Case 'desc' _ArrayReverse($aUsers) EndSwitch EndIf Return $aUsers EndFunc Func CB_GetUsersById(Const $oRequest) Local Const $aUsers = DB_GetUsers() Local $foundUser = Null For $i = 0 To UBound($aUsers) -1 Local $curUser = $aUsers[$i] If $curUser.item('id') == $oRequest.item('#id') Then $foundUser = $curUser ExitLoop EndIf Next If Not IsObj($foundUser) Then Return _API_RES_NotFound(StringFormat("Could not find user with ID %d", $oRequest.item('#id'))) EndIf return $foundUser EndFunc When you visit http://localhost:3000 you are greeted with this pleasent view that will show you all your registred routes and some extra info you have provided. When you visit http://localhost:3000/users the UDF will return the array of objects as Json And here is an example of http://localhost:3000/users/1 More examples can be found here (NEWEST 2020-09-21) Autoit-API-WS-1.0.3-beta.zip OLD VERSIONS Autoit-API-WS-1.0.0-beta.zip Autoit-API-WS-1.0.1-beta.zip
    1 point
  2. @GokAy _Excel_RangeRead Success: the data from the specified cell(s). A string for a cell, a zero-based array for a range of cells.
    1 point
  3. Yes, it does: _Excel_RangeRead 😃
    1 point
  4. Hmm, when you process this part $aMatArray[$iIndex] = $aMatArray[$i] $iIndex += 1 You are not doing anything to the $aMatArray[$i], so it is left as it is. If you are not redimming to crop the remaining (rows $iIndex +), then they are left there. Perhaps you should assign empty string to those rows? $aMatArray[$iIndex] = $aMatArray[$i] $aMatArray[$i] = "" ; add this? $iIndex += 1
    1 point
  5. Try added the cmd prompt to allow for piping the STDOUT: RunWait(@comspec & " /c PsExec.exe \\remote-server-name -accepteula -u User -p Pass tasklist /FI ""ImageName eq notepad.exe"" > C:\tmp\notepad_tasks.txt") Jos
    1 point
  6. @Musashi Thank you very much! In your code, I think you meant to use the word "initial" instead of "individual". In case anyone else is trying to do this: With Musashi's code any changes to mouse speed affect the current session only (the settings will revert after a reboot). To make the changes permanent, change the last parameter from "2" to "1". i.e. change: _WinAPI_SystemParametersInfo($SPI_SETMOUSESPEED, 0, 10, 2) to _WinAPI_SystemParametersInfo($SPI_SETMOUSESPEED, 0, 10, 1)
    1 point
  7. My friend, let me tell something essential; When people write a post like I did it isn't really open for debate but merely a friendly way of telling you something. So there is no need to respond but just listen to what was said. Hope I made myself more clear this time. Jos
    0 points
×
×
  • Create New...