ad-spend-tracker 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- # Amazon Advertising Spend Tracker v3.0
2
- # 100+ micro-tasks with anti-pattern detection measures
1
+ # Amazon Advertising Spend Tracker v3.1
2
+ # 120+ micro-tasks with precise Perpetua UI interactions
3
3
 
4
4
  Add-Type -AssemblyName System.Windows.Forms
5
5
  Add-Type @"
@@ -19,7 +19,7 @@ public class Mouse {
19
19
  $script:screenWidth = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width
20
20
  $script:screenHeight = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height
21
21
 
22
- # Task history for anti-pattern (never repeat last 10)
22
+ # Task history for anti-pattern (never repeat last 20)
23
23
  $script:taskHistory = @()
24
24
  $script:lastApp = ""
25
25
  $script:sessionStart = Get-Date
@@ -88,87 +88,111 @@ $script:microTasks = @(
88
88
  @{ id=54; cat="excel"; name="Add conditional format"; dur=@(25,75); weight=2 }
89
89
  @{ id=55; cat="excel"; name="Create pivot selection"; dur=@(30,90); weight=1 }
90
90
 
91
- # === CHROME - PERPETUA (15 tasks) ===
92
- @{ id=56; cat="chrome"; name="Load Perpetua goals"; dur=@(15,45); weight=4 }
93
- @{ id=57; cat="chrome"; name="Click goal card"; dur=@(5,15); weight=4 }
94
- @{ id=58; cat="chrome"; name="Review goal metrics"; dur=@(20,60); weight=3 }
95
- @{ id=59; cat="chrome"; name="Scroll goal list"; dur=@(5,20); weight=4 }
96
- @{ id=60; cat="chrome"; name="Check streams tab"; dur=@(10,30); weight=3 }
97
- @{ id=61; cat="chrome"; name="View bid history"; dur=@(15,45); weight=2 }
98
- @{ id=62; cat="chrome"; name="Export goal data"; dur=@(10,30); weight=2 }
99
- @{ id=63; cat="chrome"; name="Filter by status"; dur=@(5,15); weight=3 }
100
- @{ id=64; cat="chrome"; name="Search goal name"; dur=@(10,30); weight=3 }
101
- @{ id=65; cat="chrome"; name="Check notifications"; dur=@(5,15); weight=3 }
102
- @{ id=66; cat="chrome"; name="View portfolio"; dur=@(10,30); weight=2 }
103
- @{ id=67; cat="chrome"; name="Refresh page"; dur=@(5,15); weight=3 }
104
- @{ id=68; cat="chrome"; name="Click breadcrumb"; dur=@(3,10); weight=2 }
105
- @{ id=69; cat="chrome"; name="Expand sidebar"; dur=@(3,10); weight=2 }
106
- @{ id=70; cat="chrome"; name="Check date range"; dur=@(8,25); weight=3 }
107
-
108
- # === CHROME - AMAZON ADS (15 tasks) ===
109
- @{ id=71; cat="chrome"; name="Load campaign mgr"; dur=@(15,45); weight=3 }
110
- @{ id=72; cat="chrome"; name="Click campaign row"; dur=@(5,15); weight=3 }
111
- @{ id=73; cat="chrome"; name="View ad group"; dur=@(10,30); weight=3 }
112
- @{ id=74; cat="chrome"; name="Check keyword tab"; dur=@(10,30); weight=3 }
113
- @{ id=75; cat="chrome"; name="Review search terms"; dur=@(20,60); weight=3 }
114
- @{ id=76; cat="chrome"; name="Scroll campaign list"; dur=@(5,20); weight=3 }
115
- @{ id=77; cat="chrome"; name="Filter by state"; dur=@(5,15); weight=2 }
116
- @{ id=78; cat="chrome"; name="Download report"; dur=@(10,30); weight=2 }
117
- @{ id=79; cat="chrome"; name="Set date picker"; dur=@(10,30); weight=3 }
118
- @{ id=80; cat="chrome"; name="View placement report"; dur=@(15,45); weight=2 }
119
- @{ id=81; cat="chrome"; name="Check budget status"; dur=@(8,25); weight=3 }
120
- @{ id=82; cat="chrome"; name="View performance graph"; dur=@(15,45); weight=2 }
121
- @{ id=83; cat="chrome"; name="Click columns dropdown"; dur=@(5,15); weight=2 }
122
- @{ id=84; cat="chrome"; name="Export to Excel"; dur=@(8,25); weight=2 }
123
- @{ id=85; cat="chrome"; name="Switch marketplace"; dur=@(8,25); weight=2 }
124
-
125
- # === CHROME - RESEARCH (10 tasks) ===
126
- @{ id=86; cat="chrome"; name="Google search query"; dur=@(15,45); weight=3 }
127
- @{ id=87; cat="chrome"; name="Read search result"; dur=@(30,90); weight=3 }
128
- @{ id=88; cat="chrome"; name="Open new tab"; dur=@(3,8); weight=4 }
129
- @{ id=89; cat="chrome"; name="Close tab"; dur=@(2,5); weight=3 }
130
- @{ id=90; cat="chrome"; name="Switch tab"; dur=@(2,5); weight=4 }
131
- @{ id=91; cat="chrome"; name="Scroll article"; dur=@(10,40); weight=3 }
132
- @{ id=92; cat="chrome"; name="Click back button"; dur=@(2,5); weight=3 }
133
- @{ id=93; cat="chrome"; name="Bookmark page"; dur=@(5,15); weight=1 }
134
- @{ id=94; cat="chrome"; name="Copy URL"; dur=@(5,12); weight=2 }
135
- @{ id=95; cat="chrome"; name="Type in address bar"; dur=@(10,30); weight=3 }
91
+ # === CHROME - PERPETUA GOALS (20 tasks) ===
92
+ @{ id=56; cat="perpetua"; name="Navigate SP Goals"; dur=@(8,20); weight=4 }
93
+ @{ id=57; cat="perpetua"; name="Click goal row"; dur=@(3,10); weight=5 }
94
+ @{ id=58; cat="perpetua"; name="Review goal ACOS metric"; dur=@(15,45); weight=4 }
95
+ @{ id=59; cat="perpetua"; name="Review goal spend metric"; dur=@(10,30); weight=4 }
96
+ @{ id=60; cat="perpetua"; name="Scroll goals list down"; dur=@(5,15); weight=5 }
97
+ @{ id=61; cat="perpetua"; name="Scroll goals list up"; dur=@(5,15); weight=4 }
98
+ @{ id=62; cat="perpetua"; name="Click goal tabs Keywords"; dur=@(5,15); weight=3 }
99
+ @{ id=63; cat="perpetua"; name="Click goal tabs Negatives"; dur=@(5,15); weight=3 }
100
+ @{ id=64; cat="perpetua"; name="Click goal tabs History"; dur=@(5,15); weight=3 }
101
+ @{ id=65; cat="perpetua"; name="Search goal by name"; dur=@(12,35); weight=3 }
102
+ @{ id=66; cat="perpetua"; name="Filter goals Enabled"; dur=@(5,15); weight=3 }
103
+ @{ id=67; cat="perpetua"; name="Filter goals Paused"; dur=@(5,15); weight=2 }
104
+ @{ id=68; cat="perpetua"; name="Sort by ACOS column"; dur=@(3,10); weight=3 }
105
+ @{ id=69; cat="perpetua"; name="Sort by Spend column"; dur=@(3,10); weight=3 }
106
+ @{ id=70; cat="perpetua"; name="Change date range 7d"; dur=@(8,20); weight=3 }
107
+ @{ id=71; cat="perpetua"; name="Change date range 30d"; dur=@(8,20); weight=3 }
108
+ @{ id=72; cat="perpetua"; name="Click New Goal button"; dur=@(3,8); weight=2 }
109
+ @{ id=73; cat="perpetua"; name="Close goal detail modal"; dur=@(2,5); weight=3 }
110
+ @{ id=74; cat="perpetua"; name="Navigate SB Goals"; dur=@(8,20); weight=3 }
111
+ @{ id=75; cat="perpetua"; name="Navigate SD Goals"; dur=@(8,20); weight=2 }
112
+
113
+ # === CHROME - PERPETUA STREAMS (12 tasks) ===
114
+ @{ id=76; cat="perpetua"; name="Navigate SP Streams"; dur=@(8,20); weight=4 }
115
+ @{ id=77; cat="perpetua"; name="Click stream row"; dur=@(3,10); weight=4 }
116
+ @{ id=78; cat="perpetua"; name="Scroll streams list"; dur=@(5,15); weight=4 }
117
+ @{ id=79; cat="perpetua"; name="View stream bid changes"; dur=@(15,40); weight=3 }
118
+ @{ id=80; cat="perpetua"; name="Filter streams by status"; dur=@(5,15); weight=3 }
119
+ @{ id=81; cat="perpetua"; name="Check stream ACOS trend"; dur=@(10,30); weight=3 }
120
+ @{ id=82; cat="perpetua"; name="Review stream keywords"; dur=@(15,45); weight=3 }
121
+ @{ id=83; cat="perpetua"; name="Expand stream details"; dur=@(5,15); weight=3 }
122
+ @{ id=84; cat="perpetua"; name="Collapse stream details"; dur=@(3,8); weight=2 }
123
+ @{ id=85; cat="perpetua"; name="Sort streams by spend"; dur=@(3,10); weight=3 }
124
+ @{ id=86; cat="perpetua"; name="Check stream automation"; dur=@(8,25); weight=2 }
125
+ @{ id=87; cat="perpetua"; name="Navigate Analytics page"; dur=@(8,20); weight=2 }
126
+
127
+ # === CHROME - PERPETUA GENERAL (8 tasks) ===
128
+ @{ id=88; cat="perpetua"; name="Click sidebar nav item"; dur=@(3,10); weight=4 }
129
+ @{ id=89; cat="perpetua"; name="Hover sidebar expand"; dur=@(2,6); weight=3 }
130
+ @{ id=90; cat="perpetua"; name="Click account dropdown"; dur=@(3,8); weight=2 }
131
+ @{ id=91; cat="perpetua"; name="Check notifications bell"; dur=@(5,15); weight=3 }
132
+ @{ id=92; cat="perpetua"; name="Refresh current page"; dur=@(3,8); weight=3 }
133
+ @{ id=93; cat="perpetua"; name="Click breadcrumb back"; dur=@(3,8); weight=3 }
134
+ @{ id=94; cat="perpetua"; name="Scroll page randomly"; dur=@(5,20); weight=5 }
135
+ @{ id=95; cat="perpetua"; name="Mouse idle on metrics"; dur=@(8,25); weight=4 }
136
+
137
+ # === CHROME - AMAZON ADS (12 tasks) ===
138
+ @{ id=96; cat="chrome"; name="Load campaign mgr"; dur=@(15,45); weight=3 }
139
+ @{ id=97; cat="chrome"; name="Click campaign row"; dur=@(5,15); weight=3 }
140
+ @{ id=98; cat="chrome"; name="View ad group"; dur=@(10,30); weight=3 }
141
+ @{ id=99; cat="chrome"; name="Check keyword tab"; dur=@(10,30); weight=3 }
142
+ @{ id=100; cat="chrome"; name="Review search terms"; dur=@(20,60); weight=3 }
143
+ @{ id=101; cat="chrome"; name="Scroll campaign list"; dur=@(5,20); weight=3 }
144
+ @{ id=102; cat="chrome"; name="Filter by state"; dur=@(5,15); weight=2 }
145
+ @{ id=103; cat="chrome"; name="Download report"; dur=@(10,30); weight=2 }
146
+ @{ id=104; cat="chrome"; name="Set date picker"; dur=@(10,30); weight=3 }
147
+ @{ id=105; cat="chrome"; name="Check budget status"; dur=@(8,25); weight=3 }
148
+ @{ id=106; cat="chrome"; name="Export to Excel"; dur=@(8,25); weight=2 }
149
+ @{ id=107; cat="chrome"; name="Switch marketplace"; dur=@(8,25); weight=2 }
150
+
151
+ # === CHROME - RESEARCH (8 tasks) ===
152
+ @{ id=108; cat="chrome"; name="Google search query"; dur=@(15,45); weight=3 }
153
+ @{ id=109; cat="chrome"; name="Read search result"; dur=@(30,90); weight=3 }
154
+ @{ id=110; cat="chrome"; name="Open new tab"; dur=@(3,8); weight=4 }
155
+ @{ id=111; cat="chrome"; name="Close tab"; dur=@(2,5); weight=3 }
156
+ @{ id=112; cat="chrome"; name="Switch tab"; dur=@(2,5); weight=4 }
157
+ @{ id=113; cat="chrome"; name="Scroll article"; dur=@(10,40); weight=3 }
158
+ @{ id=114; cat="chrome"; name="Click back button"; dur=@(2,5); weight=3 }
159
+ @{ id=115; cat="chrome"; name="Type in address bar"; dur=@(10,30); weight=3 }
136
160
 
137
161
  # === TEAMS (10 tasks) ===
138
- @{ id=96; cat="teams"; name="Click chat thread"; dur=@(5,15); weight=4 }
139
- @{ id=97; cat="teams"; name="Read message"; dur=@(10,40); weight=4 }
140
- @{ id=98; cat="teams"; name="Scroll chat history"; dur=@(5,20); weight=3 }
141
- @{ id=99; cat="teams"; name="Check activity feed"; dur=@(8,25); weight=3 }
142
- @{ id=100; cat="teams"; name="Click channel"; dur=@(5,15); weight=2 }
143
- @{ id=101; cat="teams"; name="View files tab"; dur=@(8,25); weight=2 }
144
- @{ id=102; cat="teams"; name="Search messages"; dur=@(10,30); weight=2 }
145
- @{ id=103; cat="teams"; name="Check mentions"; dur=@(5,15); weight=3 }
146
- @{ id=104; cat="teams"; name="Scroll channel list"; dur=@(5,15); weight=2 }
147
- @{ id=105; cat="teams"; name="React to message"; dur=@(3,8); weight=2 }
162
+ @{ id=116; cat="teams"; name="Click chat thread"; dur=@(5,15); weight=4 }
163
+ @{ id=117; cat="teams"; name="Read message"; dur=@(10,40); weight=4 }
164
+ @{ id=118; cat="teams"; name="Scroll chat history"; dur=@(5,20); weight=3 }
165
+ @{ id=119; cat="teams"; name="Check activity feed"; dur=@(8,25); weight=3 }
166
+ @{ id=120; cat="teams"; name="Click channel"; dur=@(5,15); weight=2 }
167
+ @{ id=121; cat="teams"; name="View files tab"; dur=@(8,25); weight=2 }
168
+ @{ id=122; cat="teams"; name="Search messages"; dur=@(10,30); weight=2 }
169
+ @{ id=123; cat="teams"; name="Check mentions"; dur=@(5,15); weight=3 }
170
+ @{ id=124; cat="teams"; name="Scroll channel list"; dur=@(5,15); weight=2 }
171
+ @{ id=125; cat="teams"; name="React to message"; dur=@(3,8); weight=2 }
148
172
 
149
173
  # === HUMAN BEHAVIORS (5 tasks) ===
150
- @{ id=106; cat="human"; name="Pause and think"; dur=@(5,20); weight=5 }
151
- @{ id=107; cat="human"; name="Small fidget"; dur=@(2,8); weight=6 }
152
- @{ id=108; cat="human"; name="Hesitation pause"; dur=@(3,12); weight=4 }
153
- @{ id=109; cat="human"; name="Re-read and check"; dur=@(8,25); weight=3 }
154
- @{ id=110; cat="human"; name="Micro-break stretch"; dur=@(15,45); weight=2 }
174
+ @{ id=126; cat="human"; name="Pause and think"; dur=@(5,20); weight=5 }
175
+ @{ id=127; cat="human"; name="Small fidget"; dur=@(2,8); weight=6 }
176
+ @{ id=128; cat="human"; name="Hesitation pause"; dur=@(3,12); weight=4 }
177
+ @{ id=129; cat="human"; name="Re-read and check"; dur=@(8,25); weight=3 }
178
+ @{ id=130; cat="human"; name="Micro-break stretch"; dur=@(15,45); weight=2 }
155
179
  )
156
180
 
157
181
  # Category weights (time-of-day adjusted)
158
182
  function Get-CategoryWeights {
159
183
  $hour = (Get-Date).Hour
160
184
  if ($hour -ge 9 -and $hour -lt 12) {
161
- # Morning: more reporting/review
162
- return @{ excel=40; chrome=45; teams=10; human=5 }
185
+ # Morning: more reporting/review - heavy Perpetua
186
+ return @{ excel=30; perpetua=35; chrome=20; teams=10; human=5 }
163
187
  } elseif ($hour -ge 12 -and $hour -lt 14) {
164
188
  # Lunch: lighter activity
165
- return @{ excel=30; chrome=35; teams=25; human=10 }
189
+ return @{ excel=25; perpetua=25; chrome=20; teams=20; human=10 }
166
190
  } elseif ($hour -ge 14 -and $hour -lt 17) {
167
- # Afternoon: optimization work
168
- return @{ excel=50; chrome=35; teams=10; human=5 }
191
+ # Afternoon: optimization work - heavy Excel
192
+ return @{ excel=40; perpetua=30; chrome=15; teams=10; human=5 }
169
193
  } else {
170
194
  # Default
171
- return @{ excel=45; chrome=38; teams=12; human=5 }
195
+ return @{ excel=35; perpetua=30; chrome=18; teams=12; human=5 }
172
196
  }
173
197
  }
174
198
 
@@ -217,6 +241,59 @@ $script:websites = @(
217
241
  "https://advertising.amazon.com/resources"
218
242
  )
219
243
 
244
+ # Perpetua-specific pages for realistic navigation
245
+ $script:perpetuaPages = @(
246
+ @{ url="https://app.perpetua.io/am/sp/goals"; name="SP Goals" }
247
+ @{ url="https://app.perpetua.io/am/sp/streams"; name="SP Streams" }
248
+ @{ url="https://app.perpetua.io/am/sb/goals"; name="SB Goals" }
249
+ @{ url="https://app.perpetua.io/am/sd/goals"; name="SD Goals" }
250
+ @{ url="https://app.perpetua.io/am/analytics"; name="Analytics" }
251
+ @{ url="https://app.perpetua.io/am/insights"; name="Insights" }
252
+ @{ url="https://app.perpetua.io/am/reports"; name="Reports" }
253
+ @{ url="https://app.perpetua.io/am/settings"; name="Settings" }
254
+ )
255
+
256
+ # Perpetua UI element positions (approximate, based on 1920x1080)
257
+ $script:perpetuaUI = @{
258
+ # Sidebar navigation (left side)
259
+ sidebar = @{ x=@(30,180); y=@(100,600) }
260
+ sidebarSP = @{ x=100; y=180 }
261
+ sidebarSB = @{ x=100; y=230 }
262
+ sidebarSD = @{ x=100; y=280 }
263
+ sidebarAnalytics = @{ x=100; y=350 }
264
+
265
+ # Top navigation/header
266
+ header = @{ x=@(200,1800); y=@(20,70) }
267
+ searchBox = @{ x=600; y=45 }
268
+ dateRangePicker = @{ x=1400; y=45 }
269
+ accountDropdown = @{ x=1800; y=45 }
270
+
271
+ # Goals list area
272
+ goalsList = @{ x=@(220,1600); y=@(150,700) }
273
+ goalsTable = @{ x=@(250,1500); y=@(200,650) }
274
+ goalRow = @{ x=@(300,1400); y=@(220,600) }
275
+
276
+ # Goal card/detail view
277
+ goalCard = @{ x=@(300,1200); y=@(150,600) }
278
+ goalMetrics = @{ x=@(800,1100); y=@(200,400) }
279
+ goalTabs = @{ x=@(300,700); y=@(140,170) }
280
+
281
+ # Streams page
282
+ streamsList = @{ x=@(220,1600); y=@(150,700) }
283
+ streamRow = @{ x=@(250,1500); y=@(180,650) }
284
+ streamFilters = @{ x=@(250,600); y=@(100,140) }
285
+
286
+ # New Goal wizard
287
+ newGoalBtn = @{ x=1700; y=100 }
288
+ goalNameInput = @{ x=600; y=250 }
289
+ productSearch = @{ x=600; y=350 }
290
+ targetingOptions = @{ x=@(400,900); y=@(400,500) }
291
+ matchTypeCheckboxes = @{ x=@(400,700); y=@(450,520) }
292
+ acosInput = @{ x=700; y=300 }
293
+ budgetInput = @{ x=700; y=360 }
294
+ launchGoalBtn = @{ x=1750; y=50 }
295
+ }
296
+
220
297
  # ============== MOUSE FUNCTIONS ==============
221
298
 
222
299
  function Move-MouseSmooth {
@@ -325,7 +402,7 @@ function Select-NextTask {
325
402
  # Build weighted pool excluding recent tasks
326
403
  $pool = @()
327
404
  foreach ($task in $script:microTasks) {
328
- # Skip if in last 10 tasks
405
+ # Skip if in last 20 tasks
329
406
  if ($script:taskHistory -contains $task.id) { continue }
330
407
 
331
408
  # Weight by category and task weight
@@ -346,10 +423,10 @@ function Select-NextTask {
346
423
 
347
424
  $selected = $pool | Get-Random
348
425
 
349
- # Update history (keep last 10)
426
+ # Update history (keep last 20)
350
427
  $script:taskHistory += $selected.id
351
- if ($script:taskHistory.Count -gt 10) {
352
- $script:taskHistory = $script:taskHistory[-10..-1]
428
+ if ($script:taskHistory.Count -gt 20) {
429
+ $script:taskHistory = $script:taskHistory[-20..-1]
353
430
  }
354
431
 
355
432
  return $selected
@@ -518,6 +595,226 @@ function Execute-ChromeTask {
518
595
  }
519
596
  }
520
597
 
598
+ function Execute-PerpetuaTask {
599
+ param($task)
600
+
601
+ # Get Perpetua UI positions
602
+ $ui = $script:perpetuaUI
603
+
604
+ switch -Wildcard ($task.name) {
605
+ # === GOALS PAGE INTERACTIONS ===
606
+ "*Navigate SP Goals*" {
607
+ # Click sidebar SP item
608
+ Move-AndClick $ui.sidebarSP.x $ui.sidebarSP.y
609
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 4000)
610
+ }
611
+ "*Navigate SB Goals*" {
612
+ Move-AndClick $ui.sidebarSB.x $ui.sidebarSB.y
613
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 4000)
614
+ }
615
+ "*Navigate SD Goals*" {
616
+ Move-AndClick $ui.sidebarSD.x $ui.sidebarSD.y
617
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 4000)
618
+ }
619
+ "*Click goal row*" {
620
+ $x = Get-Random -Minimum $ui.goalRow.x[0] -Maximum $ui.goalRow.x[1]
621
+ $y = Get-Random -Minimum $ui.goalRow.y[0] -Maximum $ui.goalRow.y[1]
622
+ Move-AndClick $x $y
623
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 2500)
624
+ }
625
+ "*Review goal*metric*" {
626
+ $x = Get-Random -Minimum $ui.goalMetrics.x[0] -Maximum $ui.goalMetrics.x[1]
627
+ $y = Get-Random -Minimum $ui.goalMetrics.y[0] -Maximum $ui.goalMetrics.y[1]
628
+ Move-MouseSmooth $x $y
629
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 5000)
630
+ Fidget-Mouse
631
+ }
632
+ "*Scroll goals list*" {
633
+ $x = Get-Random -Minimum $ui.goalsList.x[0] -Maximum $ui.goalsList.x[1]
634
+ $y = Get-Random -Minimum $ui.goalsList.y[0] -Maximum $ui.goalsList.y[1]
635
+ Move-MouseSmooth $x $y
636
+ Start-Sleep -Milliseconds (Get-Random -Minimum 300 -Maximum 600)
637
+ $dir = if ($task.name -match "up") { 3 } else { -3 }
638
+ Scroll-MouseWheel $dir
639
+ }
640
+ "*Click goal tabs*" {
641
+ $x = Get-Random -Minimum $ui.goalTabs.x[0] -Maximum $ui.goalTabs.x[1]
642
+ $y = Get-Random -Minimum $ui.goalTabs.y[0] -Maximum $ui.goalTabs.y[1]
643
+ Move-AndClick $x $y
644
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1500 -Maximum 3000)
645
+ }
646
+ "*Search goal*" {
647
+ Move-AndClick $ui.searchBox.x $ui.searchBox.y
648
+ Start-Sleep -Milliseconds (Get-Random -Minimum 300 -Maximum 600)
649
+ [System.Windows.Forms.SendKeys]::SendWait("^a")
650
+ Start-Sleep -Milliseconds 200
651
+ $goalName = $script:campaignNames | Get-Random
652
+ $searchTerm = $goalName.Split("_")[0..1] -join "_"
653
+ Type-WithTypos $searchTerm
654
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1500 -Maximum 3000)
655
+ }
656
+ "*Filter goals*" {
657
+ # Click filter dropdown area
658
+ $x = Get-Random -Minimum 300 -Maximum 500
659
+ Move-AndClick $x 120
660
+ Start-Sleep -Milliseconds (Get-Random -Minimum 500 -Maximum 1000)
661
+ # Click option
662
+ $y = if ($task.name -match "Enabled") { 160 } else { 190 }
663
+ Move-AndClick ($x + 20) $y
664
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 2000)
665
+ }
666
+ "*Sort by*column*" {
667
+ # Click column header
668
+ $x = if ($task.name -match "ACOS") { 900 } else { 800 }
669
+ Move-AndClick $x 175
670
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 2000)
671
+ }
672
+ "*Change date range*" {
673
+ Move-AndClick $ui.dateRangePicker.x $ui.dateRangePicker.y
674
+ Start-Sleep -Milliseconds (Get-Random -Minimum 500 -Maximum 1000)
675
+ # Click a preset option
676
+ $y = if ($task.name -match "7d") { 200 } else { 230 }
677
+ Move-AndClick ($ui.dateRangePicker.x - 50) $y
678
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1500 -Maximum 3000)
679
+ }
680
+ "*New Goal button*" {
681
+ Move-AndClick $ui.newGoalBtn.x $ui.newGoalBtn.y
682
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 4000)
683
+ # Press Escape to close without creating
684
+ [System.Windows.Forms.SendKeys]::SendWait("{ESCAPE}")
685
+ Start-Sleep -Milliseconds 500
686
+ }
687
+ "*Close goal detail*" {
688
+ [System.Windows.Forms.SendKeys]::SendWait("{ESCAPE}")
689
+ Start-Sleep -Milliseconds (Get-Random -Minimum 500 -Maximum 1000)
690
+ }
691
+
692
+ # === STREAMS PAGE INTERACTIONS ===
693
+ "*Navigate SP Streams*" {
694
+ # Click Streams in sidebar or tab
695
+ $x = Get-Random -Minimum $ui.sidebar.x[0] -Maximum $ui.sidebar.x[1]
696
+ Move-AndClick $x 320
697
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 4000)
698
+ }
699
+ "*Click stream row*" {
700
+ $x = Get-Random -Minimum $ui.streamRow.x[0] -Maximum $ui.streamRow.x[1]
701
+ $y = Get-Random -Minimum $ui.streamRow.y[0] -Maximum $ui.streamRow.y[1]
702
+ Move-AndClick $x $y
703
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 2500)
704
+ }
705
+ "*Scroll streams list*" {
706
+ $x = Get-Random -Minimum $ui.streamsList.x[0] -Maximum $ui.streamsList.x[1]
707
+ $y = Get-Random -Minimum $ui.streamsList.y[0] -Maximum $ui.streamsList.y[1]
708
+ Move-MouseSmooth $x $y
709
+ Scroll-MouseWheel (Get-Random -Minimum -4 -Maximum -2)
710
+ }
711
+ "*View stream bid*" {
712
+ $x = Get-Random -Minimum 600 -Maximum 900
713
+ $y = Get-Random -Minimum 250 -Maximum 400
714
+ Move-MouseSmooth $x $y
715
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 5000)
716
+ }
717
+ "*Filter streams*" {
718
+ $x = Get-Random -Minimum $ui.streamFilters.x[0] -Maximum $ui.streamFilters.x[1]
719
+ $y = Get-Random -Minimum $ui.streamFilters.y[0] -Maximum $ui.streamFilters.y[1]
720
+ Move-AndClick $x $y
721
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 2000)
722
+ }
723
+ "*stream*trend*" {
724
+ # Hover over graph area
725
+ $x = Get-Random -Minimum 700 -Maximum 1200
726
+ $y = Get-Random -Minimum 300 -Maximum 450
727
+ Move-MouseSmooth $x $y
728
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1500 -Maximum 4000)
729
+ Fidget-Mouse
730
+ }
731
+ "*Expand stream*" {
732
+ $x = Get-Random -Minimum 250 -Maximum 300
733
+ $y = Get-Random -Minimum 220 -Maximum 500
734
+ Move-AndClick $x $y
735
+ }
736
+ "*Collapse stream*" {
737
+ $x = Get-Random -Minimum 250 -Maximum 300
738
+ $y = Get-Random -Minimum 220 -Maximum 400
739
+ Move-AndClick $x $y
740
+ }
741
+ "*Sort streams*" {
742
+ $x = Get-Random -Minimum 700 -Maximum 900
743
+ Move-AndClick $x 175
744
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 2000)
745
+ }
746
+ "*stream automation*" {
747
+ # Click automation toggle area
748
+ $x = Get-Random -Minimum 1100 -Maximum 1300
749
+ $y = Get-Random -Minimum 250 -Maximum 450
750
+ Move-MouseSmooth $x $y
751
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 3000)
752
+ }
753
+ "*Navigate Analytics*" {
754
+ Move-AndClick $ui.sidebarAnalytics.x $ui.sidebarAnalytics.y
755
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 4000)
756
+ }
757
+
758
+ # === GENERAL PERPETUA INTERACTIONS ===
759
+ "*sidebar nav*" {
760
+ $x = Get-Random -Minimum $ui.sidebar.x[0] -Maximum $ui.sidebar.x[1]
761
+ $y = Get-Random -Minimum $ui.sidebar.y[0] -Maximum $ui.sidebar.y[1]
762
+ Move-AndClick $x $y
763
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1500 -Maximum 3000)
764
+ }
765
+ "*Hover sidebar*" {
766
+ $x = Get-Random -Minimum 20 -Maximum 60
767
+ $y = Get-Random -Minimum 150 -Maximum 500
768
+ Move-MouseSmooth $x $y
769
+ Start-Sleep -Milliseconds (Get-Random -Minimum 800 -Maximum 2000)
770
+ }
771
+ "*account dropdown*" {
772
+ Move-AndClick $ui.accountDropdown.x $ui.accountDropdown.y
773
+ Start-Sleep -Milliseconds (Get-Random -Minimum 500 -Maximum 1000)
774
+ # Click elsewhere to close
775
+ Move-AndClick 800 400
776
+ }
777
+ "*notifications bell*" {
778
+ Move-AndClick ($ui.accountDropdown.x - 80) $ui.accountDropdown.y
779
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1000 -Maximum 2500)
780
+ # Click elsewhere to close
781
+ Move-AndClick 800 400
782
+ }
783
+ "*Refresh current*" {
784
+ [System.Windows.Forms.SendKeys]::SendWait("{F5}")
785
+ Start-Sleep -Milliseconds (Get-Random -Minimum 2000 -Maximum 4000)
786
+ }
787
+ "*breadcrumb*" {
788
+ $x = Get-Random -Minimum 220 -Maximum 400
789
+ Move-AndClick $x 80
790
+ Start-Sleep -Milliseconds (Get-Random -Minimum 1500 -Maximum 3000)
791
+ }
792
+ "*Scroll page randomly*" {
793
+ $x = Get-Random -Minimum 400 -Maximum 1200
794
+ $y = Get-Random -Minimum 300 -Maximum 600
795
+ Move-MouseSmooth $x $y
796
+ Start-Sleep -Milliseconds (Get-Random -Minimum 300 -Maximum 800)
797
+ $dir = if ((Get-Random -Minimum 0 -Maximum 2) -eq 0) { -3 } else { 3 }
798
+ Scroll-MouseWheel $dir
799
+ }
800
+ "*idle on metrics*" {
801
+ $x = Get-Random -Minimum 600 -Maximum 1100
802
+ $y = Get-Random -Minimum 200 -Maximum 500
803
+ Move-MouseSmooth $x $y
804
+ # Just hover and look
805
+ Start-Sleep -Milliseconds (Get-Random -Minimum 3000 -Maximum 8000)
806
+ if ((Get-Random -Minimum 1 -Maximum 100) -le 40) { Fidget-Mouse }
807
+ }
808
+ default {
809
+ # Generic Perpetua interaction
810
+ $x = Get-Random -Minimum 300 -Maximum 1200
811
+ $y = Get-Random -Minimum 200 -Maximum 600
812
+ Move-MouseSmooth $x $y
813
+ Start-Sleep -Milliseconds (Get-Random -Minimum 500 -Maximum 1500)
814
+ }
815
+ }
816
+ }
817
+
521
818
  function Execute-TeamsTask {
522
819
  param($task)
523
820
 
@@ -622,7 +919,7 @@ function Start-Tracking {
622
919
  $script:sessionStart = Get-Date
623
920
 
624
921
  Write-Host "[TRACKING] Started at $(Get-Date -Format 'HH:mm:ss')" -ForegroundColor Green
625
- Write-Host "[INFO] v3.0 - 110 micro-tasks, anti-pattern detection" -ForegroundColor Cyan
922
+ Write-Host "[INFO] v3.1 - 130 micro-tasks, Perpetua UI, anti-pattern" -ForegroundColor Cyan
626
923
  Write-Host "[INFO] Click Excel window now. Ctrl+C to stop." -ForegroundColor Yellow
627
924
  Start-Sleep -Seconds 3
628
925
 
@@ -643,6 +940,7 @@ function Start-Tracking {
643
940
  # Execute task
644
941
  switch ($task.cat) {
645
942
  "excel" { Execute-ExcelTask $task }
943
+ "perpetua" { Execute-PerpetuaTask $task }
646
944
  "chrome" { Execute-ChromeTask $task }
647
945
  "teams" { Execute-TeamsTask $task }
648
946
  "human" { Execute-HumanTask $task }
@@ -684,10 +982,10 @@ function Start-Tracking {
684
982
 
685
983
  Clear-Host
686
984
  Write-Host "========================================" -ForegroundColor Cyan
687
- Write-Host " Amazon Advertising Spend Tracker v3.0" -ForegroundColor Cyan
985
+ Write-Host " Amazon Advertising Spend Tracker v3.1" -ForegroundColor Cyan
688
986
  Write-Host "========================================" -ForegroundColor Cyan
689
987
  Write-Host ""
690
- Write-Host "110 micro-tasks | Anti-pattern detection"
988
+ Write-Host "130 micro-tasks | Perpetua UI precision | Anti-pattern"
691
989
  Write-Host "Time-of-day awareness | Human behaviors"
692
990
  Write-Host ""
693
991
  Write-Host "Commands:"