script not working, can someone help?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wryyymuda
Posts: 32
Joined: 21 Sep 2018, 21:43

script not working, can someone help?

29 Jan 2019, 17:44

so i made a simple script originally it checks the contents of your clipboard then replaces it with what its supposed to. i tried that 3 times, none of which worked entirely. so i made a GUI function but it doesn't even work now. i will post only 2 so of the scripts can someone tell me what i'm doing wrong?
gui

Code: Select all

#singleinstance, force

gui, show, w300 h150, lol
gui, add, edit, r1 ventry x20 y20 w200 h15 gsubmit, citizen
gui, add, edit, r2 vreturn x20 y80 w200 h15 
loop {
sleep, 1000
	if ( entry = Civics ) {
			lol = the study of rights and duties of citizens
			
		}
	if ( entry = Citizenship ) {
			lol = The status of being a citizen in a country
			
		}
	if ( entry = Citizen ) {
			lol = a legally recognized subject or national of a state or commonwealth, either native or naturalized.
			
		}
	if ( entry = Service Economy ) {
			lol = people now get along by providing services to others
			
		}
	if ( entry = Value ) {
			lol = the general principles you choose to live by.
			
		}
	if ( entry = Popular Sovereignty ) {
			lol = government by consent of the governed. the principle that the authority of a state and its government is created and sustained by the consent of its people, through their elected representatives
		
		}
	if ( entry = Civics ) {
			lol = the study of rights and duties of citizens
			
		}
	if ( entry = Institution ) {
			lol = sets of ideas that people have about relationships, obligations, roles, and functions
			
		}
	if ( entry = Diverse ) {
			lol = different
			
		}
	if ( entry = Ethnic ) {
			lol = racial
			
		}
	if ( entry = Principle ) {
			lol = beliefs
			
		}
	if ( entry = Naturalization ) {
			lol = a legal process that allows you to become a US citizen
			
		}
	if ( entry = Alien ) {
			lol = visit the US but eventually return home
			
		}
	if ( entry = Immigrants ) {
			lol = move permanently to a new country and gain American citizenship each year
			
		}
	if ( entry = Deport ) {
			lol = saob a person back to their own country
			
		}
	if ( entry = Deny ) {
			lol = refuse
			
		}
	if ( entry = Obtain ) {
			lol = gained
			
		}
	if ( entry = Priority ) {
			lol = first consideration
			
		}
	if ( entry = Government ) {
			lol = is the ruling authority for a community or society
			
		}
	if ( entry = Public policy ) {
			lol = a course of government action to achieve community goals
			
		}
	if ( entry = Budget ) {
			lol = a plan for collecting and spaobing money
			
		}
	if ( entry = Democracy ) {
			lol = a system of government by the whole population or all the eligible members of a state, typically through elected representatives
		
		}
	if ( entry = Direct democracy ) {
			lol = all citizens meeting to debate government matters
			
		}
	if ( entry = Representative democracy ) {
			lol = citizens choose a smaller group to represent them, make laws, and govern on their behalf
			
		}
	if ( entry = Republic ) {
			lol = a state in which supreme power is held by the people and their elected representatives
			
		}
	if ( entry = Monarchy ) {
			lol = a government with a hereditary ruler—a king, queen, or other royal figure who inherits this position of power
		
		}
	if ( entry = Majority rule ) {
			lol = citizens agree that when differences of opinion arise, they will abide by what most people want
			
		}
	if ( entry = Authoritarian ) {
			lol = power is held by an individual or a group not accountable to the people
			
		}
	if ( entry = Community ) {
			lol = a group of people living in the same place or having a particular characteristic in common
			
		}
	if ( entry = Enforce ) {
			lol = compel observance of or compliance with a law, rule, or obligation
			
		}
	if ( entry = Constrain ) {
			lol = severely restrict the scope, extent, or activity of
			
		}
	guicontrol, text, return, %lol%
	}

guiclose:
	exitapp
	return

submit:
	gui, submit, nohide
	return
original

Code: Select all

loop {
entry = %clipboard%
msgbox,clip = %clipboard%
sleep, 1000
	ifinstring, entry, Civics  
			john = the study of rights and duties of citizens
		
	ifinstring, entry, Citizenship 
			john = The status of being a citizen in a country
		
	ifinstring, entry, Citizen  
			john = a legally recognized subject or national of a state or commonwealth, either native or naturalized.
		
	ifinstring, entry, Service Economy 
			john = people now get along by providing services to others
		
	ifinstring, entry, Value 
			john = is the general principles you choose to live by.
		
	ifinstring, entry, Popular Sovereignty 
			john = government by consent of the governed. the principle that the authority of a state and its government is created and sustained by the consent of its people, through their elected representatives
		
	ifinstring, entry, Civics 
			john = the study of rights and duties of citizens
		
	ifinstring, entry, Institution 
			john = sets of ideas that people have about relationships, obligations, roles, and functions
		
	ifinstring, entry, Diverse 
			john = different
		
	ifinstring, entry, Ethnic 
			john = racial
		
	ifinstring, entry, Principle 
			john = beliefs
		
	ifinstring, entry, Naturalization 
			john = a legal process that allows you to become a US citizen
		
	ifinstring, entry, Alien 
			john = visit the US but eventually return home
		
	ifinstring, entry, Immigrants  
			john = move permanently to a new country and gain American citizenship each year
		
	ifinstring, entry, Deport  
			john = send a person back to their own country
		
	ifinstring, entry, Deny  
			john = refuse
		
	ifinstring, entry, Obtain  
			john = gained
		
	ifinstring, entry, Priority  
			john = first consideration
		
	ifinstring, entry, Government  
			john = is the ruling authority for a community or society
		
	ifinstring, entry, Public policy  
			john = a course of government action to achieve community goals
		
	ifinstring, entry, Budget  
			john = a plan for collecting and spending money
		
	ifinstring, entry, Democracy  
			john = a system of government by the whole population or all the eligible members of a state, typically through elected representatives
		
	ifinstring, entry, Direct democracy 
			john = all citizens meeting to debate government matters
		
	ifinstring, entry, Representative democracy  
			john = citizens choose a smaller group to represent them, make laws, and govern on their behalf
		
	ifinstring, entry, Republic  
			john = a state in which supreme power is held by the people and their elected representatives
		
	ifinstring, entry, Monarchy  
			john = a government with a hereditary ruler—a king, queen, or other royal figure who inherits this position of power
		
	ifinstring, entry, Majority rule  
			john = citizens agree that when differences of opinion arise, they will abide by what most people want
		
	ifinstring, entry, Authoritarian  
			john = power is held by an individual or a group not accountable to the people
		
	ifinstring, entry, Community  
			john = a group of people living in the same place or having a particular characteristic in common
		
	ifinstring, entry, Enforce  
			john = compel observance of or compliance with (a law, rule, or obligation)
		
	ifinstring, entry, Constrain  
			john = severely restrict the scope, extent, or activity of
	clipboard = %john%
	}
return
eelrod
Posts: 65
Joined: 10 Apr 2018, 11:17

Re: script not working, can someone help?

30 Jan 2019, 08:43

Just put quotes around the text portion of your if-statement.

if ( entry = "Citizenship" ) {

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: KilliK, mikeyww and 121 guests