AutoIT Dataquest Creator

A forum for development and discussion on third party tools such as the Quest Designer

Moderator: Project Admin

AutoIT Dataquest Creator

Postby mattress » Fri Sep 02, 2011 2:00 am

Starting working on some dataquests, and figured I'd write a script to make it a little easier. What this does is take your quest input and creates an SQL INSERT query that is copied directly to the clipboard, then can be pasted into whatever SQL tool or command line your using. It's not the cleanest, but it works great, this along with the item creator already out there should make it much easier to duplicate livelike quests. Some of the descriptions in the input boxes seem a bit vague, run through a couple test quests and you'll see exactly where the fields apply. You'll need to download AutoIT to compile this, I think they may have just the compiler for download, not completely sure. Enjoy, modify, make it better, whatever, hope it helps out.
Code: Select all
; AutoIt
; Aug 2011 - mattress
; Built to create an easy SQL query to create dataquests on the DOL server
; Use/modify to your hearts content, fix'er up if you want, no credit needed, I feel good enough having got it this far!
; Some descriptions were used from Dataquest.cs from the DOL Server project

;TODO add reset buttons for field in focus, add save/load from some format (csv?), DB access?

#include <GuiConstantsEx.au3>

GuiCreate("DOL Dataquest Builder", 900, 625)
Opt("GUICoordMode", 1)

;no \ before a ' and the query will be hosed up
GUICtrlCreateLabel("IMPORTANT! Prefix any ' (apostrophe) with a backslash, ie. This is Matt\'s dataquest creator. ALL fields must be changed!", 170, 5)

;variables and stuff
$singlestep1 = GUICtrlCreateCheckbox("Single step quest?", 5, 15, 110) ;need this to change formatting on single numbers so they won't be surrounded by apostrophes.

$id1 = GuiCtrlCreateInput("Input Dataquest ID, 1 to 32,727.", 5, 40, 200)
$questname1 = GuiCtrlCreateInput("Input Dataquest Name.", 5, 60, 200)
$type1 = GuiCtrlCreatecombo("Choose Quest Type.", 5, 80, 500)
GUICtrlSetData(-1, "Standard: Talk to npc, accept quest, go through steps|Collection: Player turns drops into npc for xp, quest not added to player quest log, has no steps|Autostart: Standard quest is auto started simply by interacting with start object|Kill Complete: Killing the Start npc/mob grants and finishes the quest, similar to One Time Drops|Interact Complete: Interacting with start object grants and finishes the quest|Reward Quest: A reward quest, where reward dialog is given to player on quest offer and complete")
$startname1 = GuiCtrlCreateInput("Input Questgiver Name.", 5, 100, 200)
$startregion1 = GuiCtrlCreateInput("Input start region from DB, entering 0 indicates any object/npc with the correct name will have quest.", 5, 120, 600)
$accepttext1 = GuiCtrlCreateInput("Quest acceptance text, enter NULL if there is none, shows in chatbox.", 5, 140, 890)
$description1 = GuiCtrlCreateInput("Enter quest description to show in quest journal.", 5, 160, 890)
$sourcetext1 = GuiCtrlCreateInput("Displays the story dialog, the NPC describes the quest, put the story in first, then empty pipes for remaining steps, ie. I hate bugs, kill them||| for a 4 step quest.", 5, 180, 890)
$steptype1 = GuiCtrlCreateInput("Enter each step type separated by pipes, 0=Kill, 1=KillFinish, 2=Deliver, 3=DeliverFinish, 4=Interact, 5=InteractFinish, 6=Whisper, 7=WhisperFinish, 10=Collect, 11=CollectFinish.", 5, 200, 890)
$steptext1 = GuiCtrlCreateInput("Each step should have text associated to guide the quester, separate each step text with a pipe, ie. Kill the wabbit|Report to Elmer Fudd for a 2 step quest.", 5, 220, 890)
$stepitemtemplates1 = GuiCtrlCreateInput("If a step gives an item, enter it here, otherwise enter NULL in this box.", 5, 240, 890)
$advancetext1 = GuiCtrlCreateInput("If a character must say or whisper something to advance the quest, enter here, if none, enter NULL in this box.", 5, 260, 890)
$targetname1 = GuiCtrlCreateInput("Each target DB Mob table must be entered in order with the regionID, ex: spindly shore crab;27|spindly shore crab;27|spindly shore crab;27|Dockmaster;27.", 5, 280, 890)
$targettext1 = GuiCtrlCreateInput("Text shown to player when current step ends, enter NULL if none.", 5, 300, 890)
$collectitemtemplate1 = GuiCtrlCreateInput("Item that needs to be collected to end the current step. If no items are collected enter NULL, otherwise it needs an entry for each step. Empty values || are ok.", 5, 320, 890)
$maxcount1 = GUICtrlCreateInput("How many times can you do this quest? 0 will indicated unlimited!", 5, 340, 350)
$minlevel1 = GUICtrlCreateInput("Minimum level to accept the quest?", 5, 360, 200)
$maxlevel1 = GUICtrlCreateInput("Maximum level to accept the quest?", 5, 380, 200)
$rewardmoney1 = GUICtrlCreateInput("Input $$ rewarded for EVERY step in copper in this format: 0|0|0|500, this would indicate 5 silver for completing step 4.", 5, 400, 890)
$rewardxp1 = GUICtrlCreateInput("Input XP rewarded EVERY step in this format: 0|0|0|965, this would indicate 965 XP for completing step 4.", 5, 420, 890)
$optionalrewarditemtemplates1 = GUICtrlCreateInput("Input the id_nb value from the itemtemplate table for optional rewards, player chooses, separate items with a pipe, precede the first id_nb with a number 0 to 8, no space, NULL if none.", 5, 440, 890)
$finalrewarditemtemplates1 = GUICtrlCreateInput("Serialized list of id_nb rewards from the itemtemplate table that will be given to the player at the end of a quest, separate pipe, NULL if none.", 5, 460, 890)
$finishtext1 = GUICtrlCreateInput("The text to show the player once the quest has completed.", 5, 480, 890)
$questdependancy1 = GUICtrlCreateInput("If this quest is dependent on other quests being done first then the name(s) of those quests should be here, enter NULL if none.", 5, 500, 890)
$allowedclasses1 = GUICtrlCreateInput("Player classes that can get this quest, enter NULL for any.", 5, 520, 890)
$classtype1 = GUICtrlCreateInput("Classtype - View Dataquest.cs for description, NULL otherwise.", 5, 540, 890)

;query button
$Button_1 = GUICtrlCreateButton("Copy Query to Clipboard", 345, 570, 200)
;$Reset_1 = GUICtrlCreateButton("Reset Current Field", 445, 570, 200) TODO
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
;Case $msg = $Reset_1 TODO
;$singlestep = GUICtrlRead($singlestep1, 0)
;if $singlestep <> 0 Then MsgBox(0, "none", $singlestep)
Case $msg = $Button_1
;Read the content of each inputbox, add the 's if needed
$singlestep = GUICtrlRead($singlestep1, 0)
$id = GUICtrlRead($id1, 1)
$questname = GUICtrlRead($questname1, 1)
if $questname <> "NULL" Then $questname = StringFormat("'%s'", $questname)
$type = GUICtrlRead($type1, 1)
if $type = "Standard: Talk to npc, accept quest, go through steps" Then $type = "0"
if $type = "Collection: Player turns drops into npc for xp, quest not added to player quest log, has no steps" Then $type = "1"
if $type = "Autostart: Standard quest is auto started simply by interacting with start object" Then $type = "2"
if $type = "Kill Complete: Killing the Start npc/mob grants and finishes the quest, similar to One Time Drops" Then $type = "3"
if $type = "Interact Complete: Interacting with start object grants and finishes the quest" Then $type = "4"
if $type = "Reward Quest: A reward quest, where reward dialog is given to player on quest offer and complete" Then $type = "200"
$startname = GUICtrlRead($startname1, 1)
if $startname <> "NULL" Then $startname = StringFormat("'%s'", $startname)
$startregion = GUICtrlRead($startregion1, 1)
$accepttext = GUICtrlRead($accepttext1, 1)
if $accepttext <> "NULL" Then $accepttext = StringFormat("'%s'", $accepttext)
$description = GUICtrlRead($description1, 1)
if $description <> "NULL" Then $description = StringFormat("'%s'", $description)
$sourcetext = GUICtrlRead($sourcetext1, 1)
if $sourcetext <> "NULL" Then $sourcetext = StringFormat("'%s'", $sourcetext)
$steptype = GUICtrlRead($steptype1, 1)
if $singlestep = "1" Then $steptype = StringFormat("%s", $steptype)
if $singlestep <> "1" Then $steptype = StringFormat("'%s'", $steptype)
$steptext = GUICtrlRead($steptext1, 1)
if $steptext <> "NULL" Then $steptext = StringFormat("'%s'", $steptext)
$stepitemtemplates = GUICtrlRead($stepitemtemplates1, 1)
if $stepitemtemplates <> "NULL" Then $stepitemtemplates = StringFormat("'%s'", $stepitemtemplates)
$advancetext = GUICtrlRead($advancetext1, 1)
if $advancetext <> "NULL" Then $advancetext = StringFormat("'%s'", $advancetext)
$targetname = GUICtrlRead($targetname1, 1)
if $targetname <> "NULL" Then $targetname = StringFormat("'%s'", $targetname)
$targettext = GUICtrlRead($targettext1, 1)
if $targettext <> "NULL" Then $targettext = StringFormat("'%s'", $targettext)
$collectitemtemplate = GUICtrlRead($collectitemtemplate1, 1)
if $collectitemtemplate <> "NULL" Then $collectitemtemplate = StringFormat("'%s'", $collectitemtemplate)
$maxcount = GUICtrlRead($maxcount1, 1)
$minlevel = GUICtrlRead($minlevel1, 1)
$maxlevel = GUICtrlRead($maxlevel1, 1)
$rewardmoney = GUICtrlRead($rewardmoney1, 1)
if $singlestep = "1" Then $rewardmoney = StringFormat("%s", $rewardmoney)
if $singlestep <> "1" Then $rewardmoney = StringFormat("'%s'", $rewardmoney)
$rewardxp = GUICtrlRead($rewardxp1, 1)
if $singlestep = "1" Then $rewardxp = StringFormat("%s", $rewardxp)
if $singlestep <> "1" Then $rewardxp = StringFormat("'%s'", $rewardxp)
$optionalrewarditemtemplates = GUICtrlRead($optionalrewarditemtemplates1, 1)
if $optionalrewarditemtemplates <> "NULL" Then $optionalrewarditemtemplates = StringFormat("'%s'", $optionalrewarditemtemplates)
$finalrewarditemtemplates = GUICtrlRead($finalrewarditemtemplates1, 1)
if $finalrewarditemtemplates <> "NULL" Then $finalrewarditemtemplates = StringFormat("'%s'", $finalrewarditemtemplates)
$finishtext = GUICtrlRead($finishtext1, 1)
if $finishtext <> "NULL" Then $finishtext = StringFormat("'%s'", $finishtext)
$questdependancy = GUICtrlRead($questdependancy1, 1)
if $questdependancy <> "NULL" Then $questdependancy = StringFormat("'%s'", $questdependancy)
$allowedclasses = GUICtrlRead($allowedclasses1, 1)
if $allowedclasses <> "NULL" Then $allowedclasses = StringFormat("'%s'", $allowedclasses)
$classtype = GUICtrlRead($classtype1, 1)
if $classtype <> "NULL" Then $classtype = StringFormat("'%s'", $classtype)

;convert variables into formatted String for clipboard
$data = StringFormat("INSERT INTO `dataquest` (`ID`, `Name`, `StartType`, `StartName`, `StartRegionID`, `AcceptText`, `Description`, `SourceName`, `SourceText`, `StepType`, `StepText`, `StepItemTemplates`, `AdvanceText`, `TargetName`, `TargetText`, `CollectItemTemplate`, `MaxCount`, `MinLevel`, `MaxLevel`, `RewardMoney`, `RewardXP`, `OptionalRewardItemTemplates`, `FinalRewardItemTemplates`, `FinishText`, `QuestDependency`, `ClassType`, `AllowedClasses`) VALUES (%s, %s, %s, %s, %s, %s, %s, NULL, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);", $id, $questname, $type, $startname, $startregion, $accepttext, $description, $sourcetext, $steptype, $steptext,$stepitemtemplates, $advancetext, $targetname, $targettext, $collectitemtemplate, $maxcount, $minlevel, $maxlevel, $rewardmoney, $rewardxp, $optionalrewarditemtemplates, $finalrewarditemtemplates, $finishtext, $questdependancy, $allowedclasses, $classtype)

ClipPut($data)

EndSelect
WEnd
Matt450/Variations of "Matt"
User avatar
mattress
Server Team
 
Posts: 277
Joined: Mon Jul 05, 2010 3:30 am
Location: Oceanside, California

Re: AutoIT Dataquest Creator

Postby Graveen » Fri Sep 02, 2011 6:41 am

Thank you mattress, very interesting. It is obvious tht we need a tool for quests. QuestDesigner - adapted to DQ - would i think by excellent.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: AutoIT Dataquest Creator

Postby mattress » Fri Sep 02, 2011 7:45 am

Still reading the C# book...wanted to do this in C#, but don't know enough yet, was able to write this and get it working in about 6 hours, works great, I'm working on the Mid tutorial quests with it....I'm thinking of writing a quick and easy item creator similar to this
Matt450/Variations of "Matt"
User avatar
mattress
Server Team
 
Posts: 277
Joined: Mon Jul 05, 2010 3:30 am
Location: Oceanside, California

Re: AutoIT Dataquest Creator

Postby Dinberg » Wed Nov 09, 2011 10:37 am

mattress is going to be my new favourite person. I love how he gets books on the subject rather than complaining things dont work! I applaud your behaviour, and if you ever get stuck on something in C#, I welcome you to message me
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: AutoIT Dataquest Creator

Postby Graveen » Wed Nov 09, 2011 10:50 am

Mattress, for the item creator, try rather to use the actual one :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: AutoIT Dataquest Creator

Postby geshi » Wed Nov 09, 2011 2:43 pm

Reminds me, is there a reason why the update and load functions were taken out of the item creator?

Or was it totally rewritten for the creator suite and simply not added back in ?
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: AutoIT Dataquest Creator

Postby Graveen » Wed Nov 09, 2011 4:31 pm

it does not have sense if it were voluntary removed, so i vote for a buggy/unfinished feature - but i'm really surprised such features are missing.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: AutoIT Dataquest Creator

Postby mattress » Wed Nov 09, 2011 11:26 pm

Mattress, for the item creator, try rather to use the actual one :)
Will do, still working on the c# dataquest builder at the moment, learning the dictionary stuff. I was on work travel when I wrote this, was bored in my hotel room, thanks for the complement Dinberg, I appreciate it, I don't like getting stuck on things, maybe I have OCD :twisted:
Matt450/Variations of "Matt"
User avatar
mattress
Server Team
 
Posts: 277
Joined: Mon Jul 05, 2010 3:30 am
Location: Oceanside, California


Return to “%s” Third Party Tools

Who is online

Users browsing this forum: No registered users and 1 guest