this is the updated task with your suggested changes, I will delete this after your next reply
Uni V2.3 Ven (9)
<top loop>
A1: Anchor
A2: Variable Set [ Name:%wait To:35 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A3: Flash [ Text:Before AI Long:Off ]
A4: Wait [ MS:%wait Seconds:0 Minutes:0 Hours:0 Days:0 ]
A5: AutoInput UI Query [ Configuration:App Package: com.myapps.application
Text: available
Variables: location(), items(), distance(), payment() Timeout (Seconds):20 Continue Task After Error:On ]
A6: Flash [ Text:%errmsg Long:Off ]
A7: Wait [ MS:%wait Seconds:0 Minutes:0 Hours:0 Days:0 ]
A8: Variable Set [ Name:%ratio To:.9 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A9: Variable Set [ Name:%Small To:26 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A10: Variable Set [ Name:%Large To:37 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A11: Variable Set [ Name:%orders To:%payment(#) Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
<loop2>
A12: Anchor
A13: If [ %orders > 0 ]
A14: Variable Section [ Name:%location(%orders) From:1 Length:3 Adapt To Fit:Off Store Result In:%locate ]
A15: Variable Section [ Name:%distance(%orders) From:1 Length:3 Adapt To Fit:Off Store Result In:%distt ]
A16: Variable Search Replace [ Variable:%payment(%orders) Search:^\$ Ignore Case:On Multi-Line:Off One Match Only:Off Store Matches In Array: Replace Matches:On Replace With: Continue Task After Error:On ]
A17: If [ %locate ~ ven ]
A18: If [ %payment(%orders) > %Small ]
A19: Variable Section [ Name:%items(%orders) From:1 Length:2 Adapt To Fit:Off Store Result In:%itemamount ]
A20: Variable Set [ Name:%itemdist To:%itemamount+%distt Recurse Variables:Off Do Maths:On Append:Off Max Rounding Digits:3 ]
A21: If [ %itemamount < 300 ]
A22: Variable Set [ Name:%temp To:%payment(%orders)/%itemdist Recurse Variables:Off Do Maths:On Append:Off Max Rounding Digits:2 ]
A23: Else
A24: Variable Set [ Name:%temp To:5 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:2 ]
A25: End If
A26: If [ %temp > %ratio ]
A27: Beep [ Frequency:3337 Duration:400 Amplitude:44 Stream:3 ]
A28: Notify Sound [ Title:Ven %payment(%orders) %itemamount Temp %temp %distt Itemdist %itemdist %locate Text: Icon:null Number:0 Sound File:Video/notification sounds/police_radio_10-4.mp3 Priority:5 Repeat Alert:On ]
A29: AutoInput Action [ Configuration:Type: Text
Value: %payment(%orders)
Action : Click Timeout (Seconds):30 Continue Task After Error:On ]
A30: Variable Randomize [ Name:%yfinish Min:2000 Max:2080 ]
A31: Variable Randomize [ Name:%xfinish Min:935 Max:1000 ]
A32: Variable Randomize [ Name:%ystart Min:2000 Max:2085 ]
A33: Variable Randomize [ Name:%xstart Min:100 Max:200 ]
A34: Variable Randomize [ Name:%swipetime Min:400 Max:500 ]
A35: Wait [ MS:386 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A36: AutoInput Gestures [ Configuration:Gesture Type: Swipe
Start Point: 125,2040
End Point: 1050,2040
Duration: 500 Timeout (Seconds):60 Continue Task After Error:On ]
A37: End If
A38: End If
A39: End If
A40: Variable Set [ Name:%orders To:%orders - 1 Recurse Variables:Off Do Maths:On Append:Off Max Rounding Digits:3 ]
A41: Wait [ MS:10 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A42: Goto [ Type:Action Label Number:30 Label:loop2 ]
A43: End If
A44: Wait [ MS:%wait Seconds:0 Minutes:0 Hours:0 Days:0 ]
A45: Variable Set [ Name:%orders To:%payment(#) Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
<loop3>
A46: Anchor
A47: If [ %orders > 0 ]
A48: Variable Section [ Name:%distance(%orders) From:1 Length:3 Adapt To Fit:Off Store Result In:%distt ]
A49: Variable Search Replace [ Variable:%payment(%orders) Search:^\$ Ignore Case:On Multi-Line:Off One Match Only:Off Store Matches In Array: Replace Matches:On Replace With: Continue Task After Error:On ]
A50: If [ %payment(%orders) > %Large ]
A51: Variable Section [ Name:%items(%orders) From:1 Length:2 Adapt To Fit:Off Store Result In:%itemamount ]
A52: Variable Section [ Name:%location(%orders) From:1 Length:3 Adapt To Fit:Off Store Result In:%locate ]
A53: Variable Set [ Name:%itemdist To:%itemamount+%distt Recurse Variables:Off Do Maths:On Append:Off Max Rounding Digits:3 ]
A54: If [ %locate ~ egg | %locate ~ may | %locate ~ ple | %locate ~ som | %locate ~ abs | %locate ~ gal | %locate ~ bri | %locate ~ ham ]
A55: If [ %itemamount < 300 ]
A56: Variable Set [ Name:%temp To:%payment(%orders)/%itemdist Recurse Variables:Off Do Maths:On Append:Off Max Rounding Digits:2 ]
A57: Else
A58: Variable Set [ Name:%temp To:5 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:2 ]
A59: End If
A60: If [ %temp > %ratio ]
A61: Beep [ Frequency:3337 Duration:400 Amplitude:44 Stream:3 ]
A62: Notify Sound [ Title:NoVen, %payment(%orders) %itemamount Temp %temp %distt Itemdist %itemdist %locate Text: Icon:null Number:0 Sound File:Video/notification sounds/police_radio_10-4.mp3 Priority:5 Repeat Alert:On ]
A63: AutoInput Action [ Configuration:Type: Text
Value: %payment(%orders)
Action : Click Timeout (Seconds):30 Continue Task After Error:On ]
A64: Variable Randomize [ Name:%yfinish Min:2000 Max:2080 ]
A65: Variable Randomize [ Name:%xfinish Min:940 Max:1000 ]
A66: Variable Randomize [ Name:%ystart Min:2000 Max:2085 ]
A67: Variable Randomize [ Name:%xstart Min:100 Max:200 ]
A68: Variable Randomize [ Name:%swipetime Min:400 Max:500 ]
A69: Wait [ MS:386 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A70: AutoInput Gestures [ Configuration:Gesture Type: Swipe
Start Point: 100,2040
End Point: 1050,2040
Duration: 500 Timeout (Seconds):60 ]
A71: End If
A72: End If
A73: End If
A74: Flash [ Text:%payment(%orders) Long:Off ]
A75: Variable Set [ Name:%orders To:%orders - 1 Recurse Variables:Off Do Maths:On Append:Off Max Rounding Digits:3 ]
A76: Wait [ MS:10 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A77: Goto [ Type:Action Label Number:30 Label:loop3 ]
A78: End If
A79: Flash [ Text:Ven 2.3, %wait Long:Off ]
A80: Variable Clear [ Name: Pattern Matching:Off Local Variables Only:Off Clear All Variables:On ]
A81: Wait [ MS:%wait Seconds:0 Minutes:0 Hours:0 Days:0 ]
A82: Goto [ Type:Action Label Number:1 Label:top loop ]