diff --git a/auto_quest/auto_quest.iss b/auto_quest/auto_quest.iss new file mode 100644 index 0000000..e69de29 diff --git a/auto_quest/auto_quests.json b/auto_quest/auto_quests.json new file mode 100644 index 0000000..e69de29 diff --git a/auto_quest/writer.iss b/auto_quest/writer.iss new file mode 100644 index 0000000..1e44009 --- /dev/null +++ b/auto_quest/writer.iss @@ -0,0 +1,75 @@ +objectdef QuestWriterController +{ + variable string CurrentNPCName + variable string CurrentStepType + variable string CurrentDialogOptions + variable jsonvalue QuestSteps = [] + + method Initialize() + { + LGUI2:LoadPackageFile["writer.json"] + } + + method Shutdown() + { + LGUI2:UnloadPackageFile["writer.json"] + } + + method OnClose() + { + Script:End + } + + method OnNPCDialogButtonClick() + { + CurrentStepType:Set["ncp_dialog"] + LGUI2.Element["mr.quest_writer.npc_dialog_properties"]:SetVisibility["visible"] + } + + method OnSetNPCNameButtonClick() + { + echo "Setting NPC Name to ${Me.Target.Name}" + This.CurrentNPCName:Set["${Me.Target.Name}"] + } + + method OnAddStepButtonClick() + { + variable jsonvalue newStep + + newStep:SetValue[$$>"{ + "type": ${This.CurrentStepType.AsJSON~}, + "params": { + "npc_name": ${This.CurrentNPCName.AsJSON~}, + "dialog_options": ${This.CurrentDialogOptions.AsJSON~} + } + }"<$$] + This.QuestSteps:Add["${newStep.AsJSON~}"] + + echo "Current Steps ${This.QuestSteps.AsJSON~}" + } + + member:jsonvalueref CurrentSteps() + { + variable jsonvalue questList + + questList:SetValue[$$>"[ + "Step 1", + "Step 2", + "Step 3", + ]"<$$] + + return questList + } + +} + +variable(global) QuestWriterController MRQuestWriterController + +function main() +{ + echo "${MRQuestWriterController.CurrentSteps.AsJSON~}" + while 1 + { + wait 1 + } +} \ No newline at end of file diff --git a/auto_quest/writer.json b/auto_quest/writer.json new file mode 100644 index 0000000..b49b987 --- /dev/null +++ b/auto_quest/writer.json @@ -0,0 +1,320 @@ +{ + "$schema": "http://www.lavishsoft.com/schema/lgui2Package.json", + "skin": { + "name": "MRSkin", + "brushes": { + "window.titleBar.backgroundBrush": { + "color": "#211C18" + } + }, + "templates": { + "mr.quest_writer.quest_steps.list_entry": { + "jsontemplate": "listboxitem", + "padding": 2, + "borderBrush": { + "color": "#f4f3ee" + }, + "borderThickness": [0, 0, 0, 1], + "content": { + "type": "stackpanel", + "orientation": "vertical", + "-contentContainer": { + "jsonTemplate": "listbox.contentContainerFitWidth" + }, + "children": [ + { + "type": "textblock", + "horizontalAlignment": "stretch", + "font": { + "bold": true, + "heightFactor": 1.1 + }, + "textBinding": { + "pullFormat": "${_CONTEXTITEMDATA_.Get[type]}" + } + }, + { + "type": "textblock", + "horizontalAlignment": "stretch", + "textBinding": { + "pullFormat": "${_CONTEXTITEMDATA_.Get[params].AsJSON[multiline]}" + } + } + ] + } + }, + "window.title": { + "verticalAlignment": "center", + "margin": [2, 0, 0, 0] + }, + "button": { + "jsonTemplate": "default:button", + "margin": [2, 2, 2, 2], + "color": "#f4f3ee" + }, + "checkbox": { + "jsonTemplate": "default:checkbox", + "margin": [2, 2, 2, 2] + }, + "window": { + "jsonTemplate": "default:window", + "backgroundBrush": { + "color": "#463f3a" + }, + "color": "#f4f3ee", + "font": { + "face": "Segoe UI", + "height": 16 + } + }, + "listbox.contentContainerFitWidth": { + "jsonTemplate": "listbox.contentContainer", + "horizontalScroll": "fit" + } + } + }, + "elements": [ + { + "type": "window", + "skin": "MRSkin", + "title": "MR Quest Writer", + "name": "mr.quest_writer.window", + "borderThickness": 2, + "hideOnClose": false, + "minSize": { + "width": 650, + "height": 350 + }, + "maxSize": { + "width": 950, + "height": 650 + }, + + "eventHandlers": { + "onCloseButtonClick": ["method", "MRQuestWriterController", "OnClose"] + }, + "content": { + "type": "stackpanel", + "name": "mr.quest_writer.content", + "uniform": true, + "heightFactor": 1, + "orientation": "horizontal", + "children": [ + { + "type": "dockpanel", + "widthFactor": 0.2, + "orientation": "vertical", + "children": [ + { + "type": "stackpanel", + "name": "mr.quest_writer.controls", + "margin": [5, 5, 15, 5], + "_dock": "top", + "children": [ + { + "type": "stackpanel", + "widthFactor": 1, + "children": [ + { + "type": "textblock", + "text": "Quest Name:", + "horizontalAlignment": "left", + "widthFactor": 1 + }, + { + "type": "textbox", + "name": "mr.quest_writer.quest_name", + "horizontalAlignment": "left", + "widthFactor": 1 + } + ] + }, + { + "type": "wrappanel", + "widthFactor": 1, + "orientation": "horizontal", + "childSize": { + "width": 75, + "height": 35 + }, + "children": [ + { + "type": "button", + "name": "mr.quest_writer.npc_dialog", + "content": "NPC Dialog", + "widthFactor": 1, + "eventHandlers": { + "onRelease": [ + "method", + "MRQuestWriterController", + "OnNPCDialogButtonClick" + ] + } + }, + { + "type": "button", + "name": "mr.quest_writer.run_path", + "content": "Run Path", + "widthFactor": 1 + }, + { + "type": "button", + "name": "mr.quest_writer.kill_mobs", + "content": "Kill Mobs", + "widthFactor": 1 + } + ] + } + ] + }, + { + "type": "panel", + "widthFactor": 1, + "_dock": "bottom", + "margin": [0, 15, 0, 0], + "children": [ + { + "type": "button", + "content": "Add Step", + "widthFactor": 1, + "eventHandlers": { + "onRelease": [ + "method", + "MRQuestWriterController", + "OnAddStepButtonClick" + ] + } + } + ] + }, + { + "type": "stackpanel", + "name": "mr.quest_writer.npc_dialog_properties", + "visibility": "hidden", + "_dock": "bottom", + "borderBrush": { + "color": "#f4f3ee" + }, + "borderThickness": [0, 2, 0, 0], + "header": "test", + "children": [ + { + "type": "panel", + "borderBrush": { + "color": "#f4f3ee" + }, + "borderThickness": [0, 0, 0, 1], + "margin": [0, 0, 0, 15], + "children": [ + { + "type": "textblock", + "text": "NPC Dialog Properties", + "font": { + "bold": true, + "heightFactor": 1.2 + }, + "horizontalAlignment": "center", + "widthFactor": 1 + } + ] + }, + { + "type": "textblock", + "text": "NPC Name:", + "widthFactor": 1, + "horizontalAlignment": "left", + "font": { + "heightFactor": 0.9 + } + }, + { + "type": "stackpanel", + "orientation": "horizontal", + "children": [ + { + "type": "button", + "content": "◎", + "tooltip": "Set the NPC name to the currently targeted NPC.", + "horizontalAlignment": "left", + "eventHandlers": { + "onRelease": [ + "method", + "MRQuestWriterController", + "OnSetNPCNameButtonClick" + ] + } + }, + { + "type": "textblock", + "horizontalAlignment": "left", + "widthFactor": 1, + "text": "${MRQuestWriterController.CurrentNPCName}" + } + ] + }, + { + "type": "stackpanel", + "orientation": "vertical", + "children": [ + { + "type": "textblock", + "text": "Dialog Options:", + "horizontalAlignment": "left", + "widthFactor": 1, + "font": { + "heightFactor": 0.9 + } + }, + { + "type": "textbox", + "name": "mr.quest_writer.npc_dialog_dialog_options", + "horizontalAlignment": "left", + "widthFactor": 1, + "tooltip": "A comma separated list of the\nnumber of the dialog option to\npick tomake the quest dialog appear.\n\ne.g. 1,2,1,1,2", + "textBinding": { + "pullFormat": "${MRQuestWriterController.CurrentDialogOptions}", + "pullReplaceNull": "", + "pushFormat": [ + "MRQuestWriterController.CurrentDialogOptions:Set[\"", + "\"]" + ] + } + } + ] + } + ] + } + ] + }, + { + "type": "stackpanel", + "heightFactor": 1, + "children": [ + { + "type": "textblock", + "text": "Quest Steps:", + "horizontalAlignment": "left", + "widthFactor": 1 + }, + { + "type": "listbox", + "name": "mr.quest_writer.quest_steps", + "heightFactor": 1, + "widthFactor": 1, + "itemsBinding": { + "pullFormat": "${MRQuestWriterController.QuestSteps}" + }, + "itemViewGenerators": { + "default": { + "type": "template", + "template": "mr.quest_writer.quest_steps.list_entry" + } + } + } + ] + } + ] + } + } + ] +} diff --git a/mr.iss b/mr.iss index 8185fa1..daaa420 100644 --- a/mr.iss +++ b/mr.iss @@ -1,3 +1,15 @@ +#include "${LavishScript.HomeDirectory}/Scripts/EQ2Navigation/EQ2Nav_Lib.iss" + +variable EQ2Nav Nav + +function StopRunning() +{ + echo "Stop Running" + press -hold "${Nav.MOVEBACKWARD}" + waitframe + press -release "${Nav.MOVEBACKWARD}" +} + function main(... params) { @@ -19,9 +31,9 @@ function main(... params) run mr/bot/export_abilities } - elseif ${command.Equal["relay"]} + elseif ${command.Equal["qw"]} { - + run mr/auto_quest/writer } elseif ${command.Equal["!c"]} { @@ -35,6 +47,31 @@ function main(... params) } elseif ${command.Equal["test"]} { - run mr/common/Navigation/test + Nav.AUTORUN:Set["num lock"] + Nav.MOVEBACKWARD:Set["s"] + Nav.STRAFELEFT:Set["e"] + Nav.STRAFERIGHT:Set["q"] + ; run mr/common/Navigation/test + echo "loading map" + + Nav:UseLSO[FALSE] + Nav:LoadMap + Nav.SmartDestinationDetection:Set[FALSE] + Nav.BackupTime:Set[3] + Nav.StrafeTime:Set[3] + + echo "moving to crafting" + Nav.DestinationPrecision:Set[1] + Nav:MoveToRegion["guild hall"] + + do + { + Nav:Pulse + wait 1 + } + while ${Nav.Moving} + + call StopRunning } -} \ No newline at end of file +} +