#This script shows how to do an action if something fails #Create a tcp serial tester and assign it to the server variable server = new Serial("TCP") #open server port 65500 server.open(65500) #Create another tcp serial tester and assign it to the client variable client = new Serial("TCP") #connect to the server on the localhost port 65500 client.open("localhost",65500) server.send("Hello\n") client.waitfor(10,"Hello") #Send the wrong response - change this to hello it you want the passed response! client.send("Helo\n") res = server.waitfor(10,"Hello") if res == failed then server.send("Try using a dictionary\n") else server.send("Goodbye\n") endif client.close() server.close() delete server delete client sleep(2)