AutoIt won't send number to browser - browser

I have a small script to auto-input data into a website after clicking some buttons to get to the inputboxes
Here the snippet that won't work:
$findButton = _ImageSearch('pioTextbox.bmp', 0, $x, $y, 0)
if $findButton Then
MouseMove($x + 10, $y + 10)
Sleep(500)
MouseClick("left")
Send("{9}")
Sleep(1500)
It successfully finds the input boxe and clicks, but simply doesn't send '9'
Note: The textbox only allows digits(just numbers)
I tried using {Numpad9} but with no difference.
Thanks for any ideas of how to send numbers where only digits are allowed
This is using firefox also, but I can use any browser

Turns out it suddenly started working, I changed something completely different and now its working with Send("{9}")
Thanks

Related

If certain thing is included in input use anything after it

Hello I am currently working on a script that goes onto a website and automatically adds an Item to cart and purchases it for you I have a script that works except the only problem is that It is only able to checkout a single Item Item. Here is an example fo the script:
Item_code = input('Item code: ')
Size = input('Size: ')
def BOT():
driver = webdriver.Chrome(executable path=
URL = .....
driver.get(URL)
while True:
try:
driver.find_element_by_css_selector(Item_code).click()
break
except NoSuchElementException:
driver.refresh()
select = Select(driver.find_element_by_id('s'))
select.select_by_visible_text(Size)
The script finds the item with the item code that I use and then selects the size from the users choice
I want to be able to write the code and the size but If I want to bot to cart two Items in different sizes I want it to type in a , and insert the next Item code and Size For example:
12345, 6789
Large, Medium
I want to somehow write that if a comma is included to read and use the code after it after it uses the first one and repeat that for every comma so If I wanted to get 3 or even 4 all I would have to do is this:
1234, 5678, 7890, etc...
Large, medium, Small, etc...
If anyone could Help me out I would really appreciate it I was thinking of something like
for , in BOT():
(something like this but Im not sure )
I know how to tell the script that if Item_code == (',') then do this but that would not work because it needs to be just the comma and I do not know how to tell it to repeat the BOT() a second time and use the second code and size
If someone could help me out I would really appreciate it thanks.
(I want to be able to share this bot since I have already made a GUI for it and all that)
(not sure if the executable path will work when sharing)
I have fixed this problem I created several custom functions and called them on special if statements
ex.
if Item.count(',') == (1):
Cart1()
Checkout()
etc.....

Arduino String.replace() not working after file name change

I have encountered a strange failure when this code runs on my NodeMCU 0.9 board. It is basically getting http code from an API in the following format:
<abbr title="klokken">kl</abbr> 11–12
In this case I want to isolate the 11 and 12 by first removing the first 42 characters which works perfectly fine and then replacing the – with --. When I open a sketch and paste this program in it it runs perfectly fine and returns 11--12 but when I save this program under a random name it is rebuilt and for some reason doesn't replace the characters properly it then returns 11–12.
I have tried to replace different parts of the string when it was rebuilt which worked fine but for some reason I can't seem to either find the index of nor replace the three strange characters.
http.begin(URL_time);
int httpCode = http.GET();
String timerange;
if(httpCode > 0){
timerange = http.getString();
timerange.remove(0,42);
timerange.replace("–", "--");
Serial.println(timerange);
Thus my question is if anyone knows how to work around this issue apart from not saving my code. Feel free to ask me to elaborate on my question when needed.
The string you're receiving is encoded in Windows Latin 1 (ISO 8859-1), and you're (probably) using UTF-8. What you need is to re-encode the string properly.

pyqt QTimeEdit/QDateTimeEdit now showing seconds

I have a QTimeEdit in my main gui window which is supposed to show the time in some sort of HH:mm:ss.zzz format
self.te_start_time = QDateTimeEdit(self.centralwidget)
self.te_start_time.setMaximumSize(QSize(150, 16777215))
self.te_start_time.setObjectName("te_start_time")
self.te_start_time.setDisplayFormat("HH:mm:ss.zzz")
self.te_start_time.setTime(QTime(9, 5, 50))
However it does not show the seconds. It shows
9:05.000 AM
It actually seems it completely ignores the setDisplayformat as I can put in any format there or not have the line at all.. it always shows the format hh:mm.zzz
Any idea what I can do to change the format to HH:mm:ss.zzz?
As titusjan and ekhumoro pointed out, it was reset somewhere else. QT designer also created a retranslateUI function that reset the format

Adding multiple slideshows on one form in Inno Setup

I would like to display multiple slideshow on one form of my Inno Script. I'm using isslideshow.dll to enter my images.
When one slideshow is displayed, everything works perfectly, but when two are displayed, one of them freezes...Also, on deinitialization only one stops while other is still present...
Does anyone knows how I can fix it?
InitializeSlideShow(WizardForm.Handle, 0, 356, scaleX(200), ScaleY(112), true, 2);
CurrentPicture:=1;
ShowImage(piclist.strings[CurrentPicture-1], 1);
TimerID:=SetTimer(0, 0, 3000, WrapTimerProc(#OnTimer, 4));
Also, the deinitialization code:
DeinitializeSlideShow;
KillTimer(0, TimerID);
I cannot find isslideshow.dll, so I do not know how it works.
But from the fact it does not return any handle to the slideshow instance, it probably is not designed for handling multiple slideshows in parallel.
What you can try is to make a second copy of the DLL (isslideshow2.dll), import its functions second time, under different names (e.g. InitializeSlideShow2) and use the second set of functions for the second slideshow.
Or use this solution for the slideshow:
Inno Setup - Multiple Images display (slideshow) on wpInstalling Page under ProgressGauge bar
It can handle any number of slideshows. Just create multiple callbacks using WrapTimerProc and multiple timers using SetTimer (though you may actually need only on timer/callback is the slideshows have the same frequency).

Get numbers of all screens in Xlib

I've been googling for quite a long time and I just can't find any information on how to get screen_number for every screen connected to computer. Here I found a list of macros and some of them (like for example ScreenOfDisplay(display, screen_number) ) use argument screen_number. However there is no such macro that could give me a list of those numbers (one for every connected screen). I know how to get number of default screen (DefaultScreen() ) and count of all screens ( ScreenCount() ) but what about other screens? I noticed that screen_number of default screen is 0, although I have only one screen connected to my computer so I can't really test what happens when there are more of them. I think that screen_number could be assigned in a very simple way which is screen_number=0 for first screen,screen_number=1 for second,screen_number=2 for third and so on but as I said... I can't test wheather it's true and even if I had multiple screens how could I be sure that it works like this for all computers .Please ,if anyone of you has more experience with X11 and knows all details about how it works,tell me if I am right.
The ScreenCount(dpy) macro and int XScreenCount(Display*) function both return the number of screens connected to the display. Valid screen numbers are 0 to ScreenCount(dpy)-1. Macros in Xlib.h confirm:
#define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens)
#define ScreenOfDisplay(dpy, scr) (&((_XPrivDisplay)dpy)->screens[scr])
Your source (2.2.1. Display Macros) provides enough information. Normally the default screen-number is 0, e.g., when connecting to the local host you could use :0.0 as indicated in the documentation for XOpenDisplay.
That is "normally". If you run VNC, normally that runs on a different display (the first 0 in the simple connection string shown).
But (reading the documentation), when an application calls XOpenDisplay, it asks for the given screen-number (which the X server may/may not honor):
screen_number
Specifies the screen to be used on that server. Multiple screens can be controlled by a single X server. The screen_number sets an internal variable that can be accessed by using the DefaultScreen() macro or the XDefaultScreen() function if you are using languages other than C (see "Display Macros").

Resources