gScrape Info Scraping Dlls (RL Compatible)

dustind900

Member
Supporter
RL Member
I will be over time releasing the dll files I created for use in gScrape. The dll files can be used with C# or AutoHotkey. Possibly other languages too, but I haven't tried.

Requires .Net 4.5

To use with AutoHotkey CLR.ahk must be included in your script.
Pro Tip: CLR.ahk can also be found in your RocketLauncherFolder as RocketLauncher\Module Extensions\CLR_L.ahk

I suck with Documentation, but I think you should be able to figure it out. What documentation there is, is now in the ahk demos for each dll.

gsMoby.dll - v1.1.0
gsMoby.dll and HtmlAgilityPack.dll must remain in the same folder.
ChangeLog:
Code:
v1.0.0 - Initial Release
	
v1.0.1 - Added Ratings to MainInfo

v1.0.2 - Added Method GetMainInfoString()
       - Added Method GetRegionalReleaseInfo()
       - Added Method GetRegionalReleaseInfoString()
       - dll is now COM Visible

v1.1.0 - Added Method GetCoverArtInfo()
       - Added Method GetCoverArtInfoString()
       - Multiple Code Improvements
       - Speed Improvement

gsGDB.dll - v1.0.0
ChangeLog:
Code:
v1.0.0 - Initial Release

Download includes:
Code:
CLR.ahk
gsMoby-Demo.ahk
gsGDB-Demo.ahk
gsMoby.dll v1.1.0
gsGDB.dll v1.0.0
HtmlAgilityPack.dll

These are free to use as you wish.
All that I ask is, if you make an app using my dlls give me a little shout out somewhere in the credits.
The dll files will be maintained and updated regularly. Suggestions are welcome.
More to come...

download
 
Last edited:

dustind900

Member
Supporter
RL Member
Added gsGDB.dll - v1.0.0 and gsGDB-Demo.ahk to the download. Documentation has been moved to the demo files.
 

billyc666

New member
RL Member
hi dustind, I wonder if you could help me, do you think it would be possible to link your moby.dll in this script using a button to search for the info ,for the relevant game and fill the fields rather than save to an xml
script is unfinished , but a member of ahk forums wrote it for me so I'm unsure regarding you dll part
Code:
#NoEnv
SetBatchLines, -1
; Predefined values ----------------------------------------------------------------------------------------------------------------
GuiTitle := "Game Info Editor"         ; main Gui title
FileDir := A_ScriptDir . "\CSVFILES"   ; path of the folder containing the files
Separator := ">"                       ; field separator
NumOfFields := 10                      ; number of fields in the game records
FieldNames  := ["Rom Name"             ; array of field names for the game record, adjust them to your needs
              , "Game Name"
              , "Year"
              , "Rating"
              , "Publisher"
              , "Developer"
              , "Genre"
              , "Score"
              , "Number Of Players"
              , "Description"]
FieldOptions := ["Disabled"            ; special Gui options for the edit fields, adjust them to your needs
               , ""
               , ""
               , ""
               , ""
               , ""
               , ""
               , ""
               , ""
               , "r10"
               , ""
               , ""]
LVW := 200                             ; width of the ListView controls
EDW := 600                             ; width of the Edit controls
; Get the height of a single-line edit control -------------------------------------------------------------------------------------
Gui, Add, Edit, vDummy, Dummy
GuiControlGet, Dummy, Pos
Gui, Destroy
EDH := DummyH
; GUI ------------------------------------------------------------------------------------------------------------------------------
Gui, Margin, 20, 10
; Create and populate the FileLV
Gui, Add, ListView, w%LVW% r10 Sort -Multi vFileLV gSubFileLV, File Name
Loop, Files, %FileDir%\*.csv
   LV_Add("", A_LoopFileName)
; Create the GameLV
Gui, Add, ListView, w%LVW% r10 Sort -Multi vGameLV gSubGameLV AltSubmit, % FieldNames[1]
; Add the text and edit fields for the game records
TXY := "ym"
Loop, %NumOfFields% {
   Gui, Add, Text, %TXY% h%EDH% +0x200, % FieldNames[A_Index]
   Options := FieldOptions[A_Index] ; special field options
   Gui, Add, Edit, xp y+0 w%EDW% %Options% vED%A_Index% gSubEditChanged +ReadOnly
   TXY := "y+2"
}
; Add the action buttons
BC := 3 ; button count
BW := 100 ; button width
DX := (EDW - (BW * BC)) // (BC - 1) ; space between butons
Gui, Add, Button, w%BW% vEditBtn gSubEditBtn, Edit
Gui, Add, Button, x+%DX% yp wp Disabled vSaveBtn gSubSaveBtn, Save
Gui, Add, Button, x+%DX% yp wp Disabled vCancelBtn gSubCancelBtn, Cancel
; Adjust the height of GameLV
GuiControlGet, L, Pos, GameLV
GuiControlGet, B, Pos, CancelBtn
LVH := BH + BY - LY
GuiControl, Move, GameLV, h%LVH%
; Show the GUI
Gui, Show, , %GuiTitle%
Editing := False
Return
GuiClose:
ExitApp
; File LV label --------------------------------------------------------------------------------------------------------------------
SubFileLV:
Gui, ListView, FileLV ; set the default ListView
If (A_GuiEvent = "DoubleClick") && (A_EventInfo) && (LV_GetNext() = A_EventInfo)  { ; double-click on an item
   LV_GetText(CurrentFile, A_EventInfo)
   Gui, ListView, GameLV ; change the default ListView
   LV_Delete()
   GuiControl, -ReDraw, GameLV ; stop redrawing
   FileRead, CurrentContent, %FileDir%\%CurrentFile%
   GameArray := [] ; initialize a real array to hold the lines
   Loop, Parse, CurrentContent, `n, `r
   {
      If (A_LoopField) {
         Fields := StrSplit(A_LoopField, Separator)   ; creates a real array of fields (AHK arrays start with index 1)
         GameID := Fields[1]                          ; use the first field as the unique ID for the game
         LV_Add("", GameID)                           ; add GameID
         GameArray[GameID] := Fields                  ; use GameID as key for GameArray
      }
   }
   Loop, 2 ; adjust the column width
      LV_ModifyCol(A_Index, "AutoHdr")
   GuiControl, +Redraw, GameLV ; redraw the ListView
   GuiControl, Focus, GameLV
   LV_Modify(1, "Select")
}
Return
; Game LV label --------------------------------------------------------------------------------------------------------------------
SubGameLV:
Gui, ListView, GameLV ; set the default ListView
If (A_GuiEvent == "I") && Instr(ErrorLevel, "S", 1) { ; a new item has been selected
   LV_GetText(CurrentGame, A_EventInfo)
   CurrentFields := GameArray[CurrentGame] ; retrieve the fields of the selected game from GameArray
   Loop, %NumOfFields% ; update the edit fields
      GuiControl, , ED%A_Index%, % CurrentFields[A_Index]
}
Return
; Edit button label ----------------------------------------------------------------------------------------------------------------
SubEditBtn:
GuiControl, Disable, FileLV
GuiControl, Disable, GameLV
GuiControl, Disable, EditBtn
Loop, %NumOfFields%
   GuiControl, -ReadOnly, ED%A_Index%
GuiControl, Enable, CancelBtn
GuiControl, Focus, ED2
Modified := False
Editing := True
Return
; Save button label ----------------------------------------------------------------------------------------------------------------
SubSaveBtn:
Gui, +OwnDialogs
Editing := False
MsgBox, 4, %GuiTitle%, Save the changes to file %CurrentFile%?
IfMsgBox, Yes
{
   Loop, %NumOfFields% { ; update the game record
      GuiControlGet, Value, , ED%A_Index%
      CurrentFields[A_Index] := Value
   }
   ; To-do: save the file!
}
; Fall through to SubCancelBtn to do the rest
; Cancel button label --------------------------------------------------------------------------------------------------------------
SubCancelBtn:
Editing := False
GuiControl, Disable, CancelBtn
GuiControl, Disable, SaveBtn
Loop, %NumOfFields%
   GuiControl, +ReadOnly, ED%A_Index%
GuiControl, Enable, EditBtn
GuiControl, Enable, GameLV
GuiControl, Enable, FileLV
GuiControl, Focus, GameLV
Gui, ListView, GameLV
LV_Modify(LV_GetNext(), "Select") ; refill the game record fields
Return
; Edits label ----------------------------------------------------------------------------------------------------------------------
SubEditChanged:
If !(Editing) ; not in edit mode
   Return
If !(Modified) ; first call while editing
   GuiControl, Enable, SaveBtn
Modified := True ; something in some of the edit control has been changed
Return
; ----------------------------------------------------------------------------------------------------------------------------------
CtlColorStatic(W, L) { ; changes the background of ReadOnly and disabled edits to white for better readability
   Static Init := OnMessage(0x0138, "CtlColorStatic") ; WM_CTLCOLORSTATIC = 0x0138
   Static DCBrush := DllCall("GetStockObject", "UInt", 18, "UPtr") ; DC_BRUSH = 18
   GuiControlGet, ControlName, Name, %L%
   If (SubStr(ControlName, 1, 2) = "ED") {
      DllCall("SetDCBrushColor", "Ptr", W, "UInt", 0xFFFFFF)
      Return DCBrush
   }
}
 
Last edited:
Top