You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to have a rand(variable: str, minvalue: int, maxvalue: int) macro operation to set a variable to some integer between min and max?
Something like .../injection/macros/macros.py:
...
from random import randint
...
def add_rand(self, variable: str, minvalue: int, maxvalue: int]):
"""Set a variable to a certain integer value between value1 and value2."""
_type_check_variablename(variable)
_type_check(minvalue, int, "value", 1)
_type_check(maxvalue, int, "value", 1)
async def task(_):
value=randint(minvalue,maxvalue)
resolved_value = _resolve(value)
logger.debug('"%s" set to "%s"', variable, resolved_value)
macro_variables[variable] = resolved_value
self.tasks.append(task)
The text was updated successfully, but these errors were encountered:
Alternatively, just give the wait() function a secondary value such that wait(100,200) waits for some value between 100 and 200.
There is already a line in parse.py that shows a wait with 2 parameters, "wait(1000).modify(Shift_L, repeat(2, k(a))).wait(10, 20).key(b)" which implies it should already be able to wait between 10 and 20ms but using that produces the error wait takes 1, not 2 parameters (type=value_error.macroparsing; symbol=wait(10,20).key(b))
Would it be possible to have a
rand(variable: str, minvalue: int, maxvalue: int)
macro operation to set a variable to some integer betweenmin
andmax
?Something like
.../injection/macros/macros.py
:The text was updated successfully, but these errors were encountered: