Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
October 2017
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
293031    

Calendar Calendar

RSS feeds


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Social bookmarking

Social bookmarking Digg  Social bookmarking Delicious  Social bookmarking Reddit  Social bookmarking Stumbleupon  Social bookmarking Slashdot  Social bookmarking Yahoo  Social bookmarking Google  Social bookmarking Blinklist  Social bookmarking Blogmarks  Social bookmarking Technorati  

Bookmark and share the address of battle programmers alliance on your social bookmarking website

yotamarker artificial intelligence walkthrough and source code

View previous topic View next topic Go down

yotamarker artificial intelligence walkthrough and source code

Post  Moti Barski on Sat Apr 14, 2012 2:20 pm

the brain algorithm

I moti barski do not allow anyone and or anybody and or any organization to receive monetary profit from this yotamarker unless writtenly approved by me personally.

you can use this for research.

invention name "yotamarker"

yotamarker v9 aka vKyu aka A.I platform aka chatbot

Background of the Invention


the field of endeavor to which the invention pertains is:
data processing-artificial inteligence.


Brief Summary of the Invention


the invention is a software that makes the
computer mimic the brain action of thinking for three brain types :
human, animal, human and animal combination.
the subject is also known as AI(artificial intelligence), the brain
algorithm, the brain software, artillect , chatbot and chobits.

however for efficiency reasons this software excludes several brain
actions:
dreaming,laughing and cerabellum.

the software was tested on windows xp profetional servicepack3 ,
amd dual core computer and msi u100 (netbook) laptop and worked glitchlessly.

Brief Description of the Several Views of the Drawing

the drawing features the software form and its controls.
please refer to the drawing added with the invention specification
below are the controls numbered as to be read on the drawing left to right up to down.


2 control name: ear ,type: textbox ,maxlength 21 (characters).
3 control name: sleep1 , type: button.
4 control name: skin ,type: textbox ,maxlength 21 (characters).
5 control name: label1
6 control name: progressbar1 , type progressbar ,this will display emotion
value.maximum value 100.
7 control name: sleepybar , type progressbar ,when it depletes the
software will go to sleep. maximum value 100.
8 control name: RadioButton1, text : human
9 control name : cbStartTic text : stop ticking

11 control name: RadioButton2, text : animal
12 control name: textbox4, maxlength : 21 (characters), visible: false
13 control name: button4, text add, visible: false
14 control name: RadioButton3, text : combo
15 control name: button5, visible false, text: remove all animal goals
16 control name: checkbox1 , type: checkbox visible false.
17 control name: label3 type: label.
18 control name: checkbox2 , type: checkbox.
19 control name: label2 , type: label
20 control name: textbox2 ,type: textbox , visible false.
21 control text: enable type: button ,visible false.
22 timer : enabled false, intervals 3000


the rest of the controls properties are set to default.


developed by moti barski from israel
contact me at :

yotamarker.justforum.net

The invention is a software written on visual basic 2010 express edition.



contents by chapters (organized chronologicaly respectingly to the software stages
(stages/ chapters 2 - 14 ):

1 prologue : variables and overall explanation
2 input
3 goalprefrence
4 the 3 free will formulas
5 the animal algorithm
6 snew : present future
7 cry
8 energy calibration
9 action
10 added reflexes
11 feedback
12 prophesy : the future
13 emotion value change
14 cycle sense
15 linger
16 sleep
17 wake

19 stand by
20 eye
21 activation : how to work the software
22 paradox
23 cerabellum
24 personality setting technique
25 robotics
26 multiple personalities
27 conclussion
28 appendix : addable features
28.2 cyborg : convert vision to skin data
29 recorder program(stand alone program)
30 the code : the full code of the software as written on visual basic 2008 express
edition
31 eye class



1 prologue

anything can be argued, but one thing is certain I think therefore I am. in the
following I will expand on the concept of thinking via explaining about my
software that mimic the brain action of thinking.

the core of thinking

the following variables represent the core of thinking and I will be using
them in my explanations :

g s p
g : goal , past, , context , subject (important data element)
s : sub goal , present time , input , consciousness
p : prophesy , future , output , action

data storage

data is stored like such (respectingly):

address: gs , gs(emotion value) , g
data: p , value , value
g,s,p store text data (strings) of 1 line each. every one of those data
pieces about 21 characters.

value is a numeric representation of emotional values which will be
further elaborated in the "emotion value change" chapter.

g , s and p can all be classified as profephesies :
g is master prophesy , s is sub prophesy and last but not least ,p is a
regular prophesy.


2 input

the brain works in cycles revolving around a timer tic event. in each
cycle there is an array of procedures that activate:
input, goalprefrence, the 3 free will formulas, snew, cry, energy calibration, action,
feedback ,prophesy, emotion value change, cycle sense and sleep wake procedures
out of that cycle.

the 2 primary senses of the brain are (seeing or hearing) and feel(skin)which are
cycled as such:
see or hear , see or hear , feel. those senses are represented as text in the software
( I named their textbox controls ear , skin (see more about this in the code).

ok lets begin with the ear input: the variable cur (short for current)
will save its(the ears') current(latest) data. so cur = ear.text. if there
is no data (quite) a counter (lazycount) increments by 1, if it riches 4
the curiousity emotion fires up (represented each time by an increasing
number 0 - 4) else (there is data) then repeatition is checked for at each cycle,
compared to the data in the previous 2 cycles.
examples of repeatition : 1 , 1 ,3 or 2,2,2 or 5, 6, 5 aka a palindrom.
notice , however, that dddd,1,2 isn't a repeatition because d repeats
inside a cycle. at the feedback stage S = cur.

if the eye class is used (see stand by chapter) lazycounter will be increased if there
is no audio data input or the image seen( *see eye chapter) repeated.

if there is repeatition an enger emotion is fired up represented by the
character "^".

if the sense cycle(the current sense being used) is skin then s = last
thought aka inner voice aka prophesy(see prophesy chapter) ,unless
there is skin input like a touch that overides it(the last thought), and data
(prophesy or touch or big temprature change) saves to the s variable.

the taste and smell senses which are not in the code (yet) are overide
senses. when they get input it overides the ear input.


3 goal prefrence

now that we have our delicious input data (in variable S) its time to
refer to the goal.
this stage is mostly used for counting or threatning. if g = s meaning
the goal has manifested then a prophesy is extracted from gs(of g and goal
temp (g,goaltemp respectingly g,s)) then goal temp = prophesy, and p now
equals goaltemp. goaltemp is arbitraraly set to "$" by default. this and
many of the stages can be also understood when running the software step
by step in visual basic 2008 express edition.

4 the 3 free will formulas

the cats meow , the 3 free will formulas ( developed by moti barski
( just a reminder )). the first two formulas determine action for a
specific event in a specific context.

legend : g = goal, s = input, p = output
gs is a dictionary type variable of goal subgoal keys as strings and its
values are emotionvalues as integers:
key(g & s as string), value(respective g & s as integer)

gd is a dictionary type variable of goal keys as strings and its values
are emotionvalues as integers:
key(g as string), value(respective g as integer).


formula 1 of 3 : if gp ( gs of gp ) + sp( gs of sp ) < gsnew ( gs of g,snew ) +s,snew
( gs of s,snew). then activate the regret procedure and now the new prophesy of the
current gs is snew ( p = snew ).

regarding formula 1, if snew (refer to its chapter) current data was
input more then half its goal value times betwin wake, sleep procedures or cry(if activated)
, sleep procedures the formula doesnt trigger an event (regret procedure).
formula 1 does not activate if g = s or if s doesn't exit in snew dictionary.

formula 2 of 3 : if gp ( gs of gp ) + sp( gs of sp ) <= gcur ( gs of g,cur ) +s,cur
( gs of s,cur ). then activate the regret procedure and now the new prophesy of the
current gs is cur ( p = cur ).

formula 3 of 3 : this formula determine the goal aka context for the software :
if gs( gs of gs ) + 1 < p( gd of g ) then g = p thats basicly all there is to it for more
elaboration refer to those formulas in the think procedure.
the + 1 of formula3 determines if the software will behave like a man or a woman
for the range 0-3 the lower the more manlly, this range is called the corpus collusm.
if the +1 is replaced by a higher number ( 2 or 3), 1 - 5 days per month the software
will think as a women.


5 the animal algorithm

the bee's knees , the animal brain.for humans any data piece
compilation (thought) can be a goal, while animal goals cyrcle around
survival. mostly animals would have about only 4 goals for example:
hunger,fighting...

the user will chose 1 of 3 brain modes by pressing on a radio button
on the form : human, animal, combo. the user choised brain mode is
saved on a text file in the volaris named folder that is in the chobits
folder.

code wize the difrence manifests in the 3rd freewill formula, in the
animal case when a survival goal is prophesized the current goal is
reset to that prophesy. the above mentioned animal (survival) goals are
saved to a folder I arbitrarely named animal, as the software loads it
loads all the animal goals to the animal dictionary variable (of string,
string),than when the software reaches the 3 free will formulas it
will execute 1 of three :

1 if the user chose the animal brain mode and the prophesy is one of the
animal goals the goal is set to the prophesy string.

2 if the user chose the human brain mode : this case was mentioned
in the chapter "the 3 free will formulas" see formula 3.

3 if the user chose the combo brain mode and the software systeins
the condition of the 3rd free will formula or the prophesy is contained
in the animal dictionary, than the goal is set to the prophesy string.

additionaly, animals have diffrent input sensors and output devices.
avatar
Moti Barski

Posts : 91
Join date : 2011-08-02

View user profile

Back to top Go down

written and posted by moti barski

Post  Moti Barski on Sat Apr 14, 2012 2:22 pm

I moti barski do not allow anyone and or anybody and or any organization to receive monetary profit from this yotamarker unless writtenly approved by me personally.

you can use this for research.

6 present future aka today memory (snew bank)

at the begining of the software a dictionary type is created the Snew
bank. S representing the present and "new" representing future or prophesy
(similar to the variable p) or specificly an idea. at this stage s and p
are saved to the bank unless their gs emotional value is lower than 5 an
arbitrery number reresenting low emotional value. new will be used in the
stage "the 3 free will formulas" in the first formula to transport ideas
from 1 goal to another.


7 cry

this stage fires up when the gs and/or goal(g) emotionvalue riches the
maximum value. repectingly the emotionvalue of gs or goal(g) is reset to a
lower value (i chose the value 6). you are invited to have a look at
the source code, cry procedure. the maximum emotion value in the code is
50 - 100 (programmer select value from range).


8 energy calibration


refer to the software for the energy calibration procedure for more data.

if gs > 20 exe bank = 2, if gs > 5 exebank = 1 respectfully :
2 actions of high energy are done, 1 action of high energy is done
for 2 or 1 think cycles. then rest cycle exebank is 0 no matter what.

if formula 2 was activated exe bank = 0 so the current data isn't repeated
by the software.


9 action

this is the software's output stage. the prophesy P is executed.execution
is done as such:

step 1 reflexes (refers to the vr (virtual reality) procedure (in the code
of the software)). the vr procedure checks the prophesy and then does
whatever the programmer chooses to do in each case. example: I chose that
in the case the line "the time is" is inputed, the software will get the
time. this stage works as a reflex because any reaction can be set for any
prophesy (by adding a case to the vr procedure). if a specific case isn't set
no reflex is activated for that specific case.

step 2 execute each data piece separetely

if exebank > 0 the prophesy is:
spoken through the computer speakers and written to ear.text field.
else (exebank = 0)
the prophesy is written to skin.text field. refer to the eye chapter for robotic
in the action stage.

emotions (special cases):
anger marked as "^" will fire up (as a reflex) a linger execution if conditions are met
more about lingering in its chapter.

fear marked as "!" will fill up the exebank to the value 2(more about exebank in the
chapter energy calibration).

curiousity marked as number 0 , 1 ... 4 each will do a methode of the
programmers chosing as stated in the action per data procedure by the
programmer. robotics example walk, grab, look left right.4 will release a *methode from
working.a methode will be activated or deactivated by the vr procedure(as a reflex).

*methode : this will make an action work constantly it is based on human
methodes such as walking , holding(holding with a hand), tapping.

if cs = 3 meaning the software thinks at this cycle and input is got from skin sense then
if exebank > 0 the software will speak but the output string (p) is written to the skin
textbox.


10 added reflexes

the input volaris will fire up a reflex to do the following :
if the brain mode is human it is set to combo, else it is set to human

the input karenis will fire up a reflex to do the following :
all of the survivor goals are deleted, the animal dictionary is emptied and the
brain mod is set to human.


11 feedback

this stage comes after the action stage.the variable I will be explaining
about is S reresenting consciousness , input the present and such.

if the current sense is skin (a field containing thoughts or skin data)
then s = p unless strong input was given (this could represent *shouting or complete darkness
("!" or phisycle hits in future models) in which case s = strong input. in
this ver of the software strong input can be manualy given by the user, by
changing the skin.text manualy but this is not recomended.

if the curent sense is hearing and input was recieved then s = cur
(input) otherwise s = p which is skin.text in the softwre.



12 prophesy

it is time for the algorithm's main charecter to shine. gs fires up its
prophesy p = prophesy of gs.


13 emotion value change

gs and g's emotional values represent patience reservoires. if an element
repeats more times than the reservoir value it(the reservoir) depletes
other wise (if element repetition througe a day is lower then reservoir
start value(start value = reservoir value after wake) the
reservoir increases.this stage is aplied for s as g(goal) reservoir and gs
as gs reservoir.additionaly if s reservoir is depleated gs reservoir
decreases also.


14 cycle sense

the sense (cs variable(integer) in the software code) is cycled ear,ear,
skin (respectingly 1,2,3).with one exaption if the input is completly new
to the software the default prophesy is arbitreraly "$", at which case cs
(cycle sense or curent sense) is set to 1 in order to prevent a glich.


15 linger

this code represents the brain technique of repeating a data piece
repeatedly and awarely ,not to be confused with a methode which requires
no thought after first activation.

example of lingering : zimbabue ,zimbabue ,zimbabue ,zimbabue .

to enable this code :
1 press the enable linger checkbox
2 enter moti barski in the now visible textbox
3 press the now visible enable button

to disable this code :
uncheck the enable linger checkbox or press the enable button while a
password different than moti barski is in the now visible textbox.

this code will not be activated if the repeating element is the goal.
linger releases any and every methode from working.

if the program is lingering the user can fear it to stop the lingering by a loud sound.
avatar
Moti Barski

Posts : 91
Join date : 2011-08-02

View user profile

Back to top Go down

moti barski's yotamarker

Post  Moti Barski on Sat Apr 14, 2012 2:24 pm

I moti barski do not allow anyone and or anybody and or any organization to receive monetary profit from this yotamarker unless writtenly approved by me personally.

you can use this for research.

16 sleep

stage trigers :
1 the arbitrarely chosen time 00:00.

2 sleepybar value = 0 ( or < 1 ) . sleeby bar is set at the wake time to
100 value and decreases by 1 integer each time an emotional value which
riched its reservoir limit is used ( for more about sleepybar see the
begining of the computer program listing appendix cd ), riched its reservoir
limit, been used a number of times equal to the reservoir after wake time.

stage action

goal(g) emotion values and gs emotion values are decreased by a small
amount I chose the amount 2. additionaly the emotion value will not
decrease below a minimum ( I choose the minimum 5 ). the stage does not
contain dreaming.as the sleep ends the software awakens.


17 wake

this stage is the first to activate(fires up at load time or after sleep
stage). the title says it all the software wakes up.g s and p recieve
default data:
g = skin field data if this field is empty g is arbitreraly = "$"
s = "$" (arbitreraly chosen character) which , basicly, represents wake up
event.
p = the prophesy contained in gs.

now the software is ready to start its day.the next stage to take place is
the "extra stage" (which is in the procedure think , that encapsulates all
the procedures mentioned in the above chapters).


19 stand by

triggered by a timer tick event : if an image that didn't repeat in succession or other new data was not input
then think, else wait up to about 10 minutes for input,if 10 minutes passed and there is
no input then think and the input is only the eye string of the image (see eye chapter).
the think sub starts the input sub.


20 eye

eagle eye, the eye algorithm.this is an example of a vision system:
an image is captured, next the eye class gets an average of lightness of the
points : east, west, north, south and middle which is the first of 11 eye chars
each containing 5 points, next any point of lightness value lower than the formentioned
average + dark_pixel_rgb is concated and zipped to 1 character to be concated with the ear string.
the 10 remaining eye chars are columns(vertical) of 5 points.

Public dark_pixel_rgb As Integer = 20 'the higher the more contrast the lower the bigger image spectrum




21 activation

the code was written on visual basic 2010 express edition.



1 install the dot net ( .net ) framework. it installs with visual basic(vb.net).
2 place a folder named chobits in c:\
3 place a folder named goals in the chobits folder , here the goals and
their emotionvalue are stored.
4 place a folder named goalsub in the chobits folder here the gs and their
prophesies are stored.
5 place a folder named emotionvalue in the chobits folder here the gs
emotionvalue are stored.
6 place a folder named animal in the chobits folder here the survival goals
are stored.
7 place a folder named volaris in the chobits folder here the brain mode
is stored.
8 place a folder named voice in the chobits folder here the output sound file are stored
9 place a folder named recorded in the chobits folder here the recorded sounds of the
record program are stored.
10 if stages 1-9 are done fire up the software.

to start the software click the listbox control once.

when turning it off first press the sleep button.

the show goal check box : when checked this will provide additional data
for the user ,namely, the current goal of the software.

to add a survival goal :
1 chose the animal or combo radiobutton.
2 copy text from ear textbox, paste in the now visible textbox.
3 press the now visible add button.


check the linger checkbox and type kavagi then press enable button to visible the pause
continue tic checkbox.
check the linger checkbox and type choriso sharingan then press enable button to visible
the show goal checkbox.

if you want the software to do turing test chats paste in the input the finale word or
sentence of the other person to the input textbox, this is the difference between why
and how, why is for negging women and gets to nowhere, how is invention solution and
interest.


22 paradox

a paradox is an event that souldn't exist, negated by a paradox
agent(disabler of the paradox).paradox have a low emotion value because
it has a low or none existing repeatition rate or it over repeats (like
a rerun of a tv show ).

examples of paradox (mostly dangers): falling from a high place,
touching acid bare handed, loop events (like an endless while loop).

examples of paradox agents : deleting (backspace, delete button,
crossing off), fire, ignoring and using indirect
prefrences.a paradox agent can also be a paradox for example ,
water is the paradox agent of the paradox fire which could in
another context be the paradox agent of a carbon based material.

as the software grows it will learn to prophesize the proper
paradox agents to paradoxes thously avoid danger and bordam.
code wize the software prefers the higher emotion value element in
the paradox cases the agents are preffered to the paradox events.

to sum it up : the paradox agents replece the paradox.


23 cerabellum

the cerabellum stage isn't in the software never the less I will explain about it just in
case.

located in the lower back part of the brain it:

1 translates data signals to data pieces.cerabellum sub will translate
input (data signals) to the coroponding datapieces(acsii characters
in the software).

2 correct translation of cerabellum. a signal is activated causing an
action event, which is the new datapiece linked to the signal.
fire up conditions of step 2 (done for any or every signal):
A after sleep before wake sub.
B manualy by the programmer by using a chosen event.
C automaticly (programable event handler).

if the programmer links all the signals to thiere datapieces himself
step 2 can be amited.


24 personality setting technique

in the particular case there is only one user who wants the software to have a
personality diffrent than the user's, the software sould be fed with dialog betwin
the user and the desired personanoty during the very begining of the software
( when the software has little or no thoughts ).

after a while if the user provides statements (input) of his regular personality
the software will retaliate with the desired personality.

alternitivly, if the user inputs his regular statements and ideas and only one user
interacts with the software than it will have a more consistent personality.

note that this chapter refers to a human user's input but the software will behave
the same behavior with the input from the environment such as the system time.

the software will get ideas when high goal emotion value sentences are input.


25 robotics

modifications to the eye using code :
add a robotics class, in action sub send 11 first chars (eye chars) to the
robotic class to exute according to the visual data. if formula 3 was activated
look according to the first eye char. the class can use "usb motors" or
usb motor or usb dc motor or usb stepper motor or usb motor board...

if the software is walking or driving :
the stand by phase will not pause 10 minutes. see addable features for drive.
also the timer period can be reset to alower value.

for curiousity string 0-4 the programmer will chose a robotic action or methode
such as walking, grabing, look around and such. # 4 will release any methode from working.


26 multiple personalities


after the software wakes she will use a different data bank (the folders mentioned
in activation chapter) , also she will sleep more times per 24 hours. additionaly
an emotion can trigger sleep.and a different data bank can trigger the use of animal goals
for only that respective data bank (g, gs text files).


27 conclussion

the following is the conclussion that best describe the algorithm and software
representing the brain : life is meaningless but we find intresting things along the
way.
avatar
Moti Barski

Posts : 91
Join date : 2011-08-02

View user profile

Back to top Go down

Barski Moti's work

Post  Moti Barski on Sat Apr 14, 2012 2:25 pm

I moti barski do not allow anyone and or anybody and or any organization to receive monetary profit from this yotamarker unless writtenly approved by me personally.

you can use this for research.

28 appendix : addable features

0 war technique : set a color to enable weapone system robotics and a color to inable it
you can use the get pixel color in the book battle programming 2011 6th edition

1 special notes

A a reflex can be a methode.

B Different metodes fired up by curiousity could vary in accordance to
the current goal.

C skin can be input to the ear field( ear.text (the ear text box) ).


2 power alocation

the higher the gs emotion value the more power of output execution,
this can make the Difference BETWEEN walking and running.
moreover, during the linger stage power alocation will aquire the
max value.if movement is jammed power will increase by about 50 %.

finaly the ! data piece will increase power alocation to 100% for the
next 2 actions (not a must piece of code).

3 reflexes

sidestep : refer to its drawing

emp it up : if the think methode is summoned by a timer tic event the
input "emp it up" will cause the tic event to shorten causing slow
motion type of input.the emped state will last for 10 - 15 seconds.it
is also Efficient to fire it up when the robot is facing very high
tempratures.

leg bump while walking : if the front or side of the leg is bumped then
the leg will make an extra step turning the body about 45 degris then
releasing the walk methode(standing).

temprature : if the temprature is too hot or cold the robot will
release any methode and reset the position of its arms.

throw while holding : the grasp releases.

reflex overide priority : reflexes might fire up sevral at once, the
programmer will chose ,in this case ,what reflex is input.

finger tip partly touched at botom only : press.

4 methodes

type and point : using the index finger or its robotic representation
each letter or shape is scouted for in the nearby environment if found
press center of sight area else return to normal action techniques.this
methode can be fired up by a pointing event during grab methode

curiousity caused methodes : look around (not a methode), walk , grab ,
special methode or action chosen by programmer or read , release.

addable program technique : the curiousity caused methodes are goal
dependant.

5 input sensors options
microphne , camera , bumper sensores , compose , gps , webstreams ,
data streams , temprature , radio ...

6 output devices

to send output commands you can use the sendkeys sub of visual basic
2008 express edition simultanously with the software robot basic (
you can read McGraw.Robot.Programmers.Bonanza.May.2008.eBook-ELOHiM.pdf
only the appendix), or use the robotic techniques of visual basic.

7 special actions

stand up: curiousity fires up the walk methode while sitting.

turn while walking or driving : the robot looks left right every sence cycle if the
emotion value is greater then 6 or a higher value defined by the programmer then
the robot turns, else she advances straight.

8 combo methode actions

a switch system will make certain actions replace common actions,
mostly during methodes.for example when holding a pen the up action
will move the hand not the arm.

9 automatic independent actions (completly thoughtless)

reset system : every x amount of time certain parts(robotic or virtual)
will return to a set position.

hunger : when the robot battery reaches a low power percentage a beep
will fire up , the lower the power the more frequent the beep.if the
robot gets the power via a person or a prepechual source than emmit
this code.hunger is based on negging it is a negging beep.

reset vision : when detecting no picture or evry x amount of time the
eye and head location are reset( facing north ).

hand positioned behind head : if that hand is grabing it will release.

10 robotic addable features :

android : reflexes methodes and techniques have been mentioned.you can
place its robotic parts in a silicon based doll.

the robot will be stronger than diamond if it is built from carbonado.

bird : replace grab methode with beak , add curiosity methode fly which
is like walk methode but uses flight techniques like a helicopter.

reflex : if lower abdomen toucheched and head not lowered then peck
hard.

weapon activation : program a key sentence to activate weopon reflex
or reflex and metode (machine gun).

detect rapid or significant movement from above : duck and fly.

falling and not flying : fly reflex fire up.

car : drive instead of walk.

laser proximity meter can replace eye cam.

doors output devices(controlled by car) that function as hands also
receiving input(weather they are being moved).

weapon activation : same as the bird robot.also can activate nitro
boost.

queen ant : all robots can use the human or animal brain algorithm.
the queen ant must have 2 more features :

1 when close to regular ants it will send a signal to reduce thier
power allocation to a low value so they cant injure her.this can be
done by radio signals.

2 the regular ants use the animal brain, one of their goals is set
to the queen ant current goal when her goal is reset.

additionaly, you can give the ant robot a drill covered with powdered
diamond and add a drill methode (fired up by curiousity).

also add feelers (bumper sensors) to get skin input.


28.2 cyborg : convert vision to skin data

first an image is captured as a bitmap then an eye string of the image is get from
the eye class , finally each eye point is converted to a robotic part placed
on a blind humans' body : first 5 points are placed on head hands leg and stomack.

see chapters of eye, robotics in software code (press ctrl+f to search 'ROBOTIC).
avatar
Moti Barski

Posts : 91
Join date : 2011-08-02

View user profile

Back to top Go down

recorder

Post  Moti Barski on Sat Apr 14, 2012 2:26 pm

29 recorder program(stand alone program)

records 3 seconds after 1 second not recording
controls : timer,button,textbox all default properties

Code:
Public Class Form1
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
    Dim c As Integer = 0
    Dim c2 As Integer = 1
    ' play audio code
    'My.Computer.Audio.Play("c:\record3.wav", AudioPlayMode.Background)
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        c = 0
        Button1.Text = "recording"
        Try
            ' record from microphone
            mciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
            mciSendString("record recsound", "", 0, 0)
            Timer1.Enabled = True
        Catch ex As Exception
            MsgBox("connect microphone")
        End Try
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If c > 2 Then
            ' stop  and save
            mciSendString("save recsound C:\chobits\recorded\" & c2.ToString & ".wav", "", 0, 0)
            mciSendString("close recsound", "", 0, 0)
            c2 += 1
            Button1.Text = "record"
            Timer1.Enabled = False
        Else
            c += 1
        End If
    End Sub

    Private Sub TextBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
        Try
            If e.KeyCode = Keys.Enter And TextBox1.Text <> "" Then
                c2 = TextBox1.Text
            End If
        Catch ex As ApplicationException
            MsgBox("enter a number")
            TextBox1.Text = ""
        End Try
    End Sub
End Class
avatar
Moti Barski

Posts : 91
Join date : 2011-08-02

View user profile

Back to top Go down

moti barski's yotamarker source code

Post  Moti Barski on Sat Apr 14, 2012 2:28 pm

I moti barski do not allow anyone and or anybody and or any organization to receive monetary profit from this yotamarker unless writtenly approved by me personally.

you can use this for research.

30 the code: the full code of the software as written on visual basic 2010 express
edition

text to speak : in the vb environment add a reference (project, add
reference, com) microsoft sapi speech 5.0. if the program speaks numbers it means.wav files
are missing (see pokemon ear chapter), also see in code Imports SpeechLib.

Code:
Imports System.Collections.Generic
Imports System.IO
Imports System.Math
Imports SpeechLib

Public Class Form1
    Dim hasSlept As Boolean = False
    Dim voice = New SpVoice 'voice instace
    Dim gd As New Dictionary(Of String, Integer)
    Dim gs As New Dictionary(Of String, Integer)
    Dim snew As New Dictionary(Of String, String) 'idea bank
    Dim animal As New Dictionary(Of String, String) 'animal goals bank
    Dim lag As String 'last animal goal
    Dim klag As String '2nd last animal goal
    Dim linger_blocker As Boolean = False
    Dim cs As Integer 'cycle sense
    Dim g, s, p, goaltemp, cur, s2, sear3 As String
    Dim methodetodo As Char
    Dim cried As Boolean = False
    Dim mbool As Boolean = False
    Dim gpref_bool As Boolean = False
    Dim lingercounter As Integer
    Dim formula2 As Boolean = False
    Dim volaris As Integer 'indecates type of brain 1,2,3 respectingly human,animal,combo
    Dim exebank, methode1, exp, lazycounter As Integer
    Dim virtualexe As Integer
    Dim rest As Integer
    Dim outputedString As String = "" 'voice recognition
    Dim waitBool As Boolean = False 'voice recognition
    Dim waitMin As Integer = 61    'voice recognition
    Sub populate()
        klag = "1"
        If Not File.Exists("C:\chobits\animal\1.txt") Then
            File.WriteAllText("C:\chobits\animal\1.txt", "")
        Else
            Dim templag As String = ""
            Dim str As StreamReader
            str = New StreamReader("C:\chobits\animal\1.txt")
            lag = str.ReadLine()
            While lag <> ""
                animal.Add(lag, "")
                klag = lag
                str.Close()
                str = New StreamReader("C:\chobits\animal\" & lag & ".txt")
                templag = str.ReadLine()
                animal(lag) = templag
                lag = templag
            End While
            str.Close()
        End If
    End Sub
    Sub sleep()
        'Timer1.Interval = 600000 'decoration only
        playaudio("C:\chobits\Music\CHI04.WAV") 'decoration only
        clear()
        skin.Clear()
        Dim gdtemp As Integer
        For Each pair As KeyValuePair(Of String, Integer) In gd
            gdtemp = Abs(pair.Value - 200)
            If gdtemp < 500 Then
                gdtemp = 500
            End If
            gdtemp = gdtemp \ 100
            File.WriteAllText("C:\chobits\goals\" & pair.Key & ".txt", gdtemp)
        Next
        gd.Clear()
        Dim gstemp As Integer
        For Each pair As KeyValuePair(Of String, Integer) In gs
            gstemp = Abs(pair.Value - 200)
            If gstemp < 500 Then
                gstemp = 500
            End If
            gstemp = gstemp \ 100
            File.WriteAllText("C:\chobits\emotionvalue\" & pair.Key & ".txt", gstemp)
        Next
        Dim tempdict As New Dictionary(Of String, String)
        For Each pair As KeyValuePair(Of String, String) In snew
            If Not (gs(pair.Key & pair.Value) \ 100 < 6) Then
                tempdict.Add(pair.Key, pair.Value)
            End If
        Next
        snew.Clear()
        For Each pair As KeyValuePair(Of String, String) In tempdict
            snew.Add(pair.Key, pair.Value)
            g_data_for_snew(pair.Value)
            g_data_for_snew(pair.Key) ' not necacery line
        Next
        tempdict.Clear()
        gs.Clear()
        wake()
    End Sub
    Sub linger()
        If lingercounter < 4 Then
            lingercounter += 1
            ear.Text = s2
            playaudio("c:\chobits\voice\" & p & ".wav") 'check
        Else
            cs = 1
            lingercounter = 1
        End If
    End Sub
    Sub wake()
        virtualexe = 0
        lazycounter = 1
        rest = 0
        formula2 = False
        sleepybar.Value = 100
        cs = 1
        lingercounter = 1
        goaltemp = "$"
        exp = 0
        If skin.Text = "" Then
            skin.Text = "$"
        End If
        g = skin.Text
        s = "$"
        mbool = True
        g_data_for_g()
        gs_data_exist(g, s)
        g_data()
        methode1 = 0
        prophesy()
    End Sub
    Sub clear()
        ear.Clear()
        If cs = 3 And exebank = 0 Then
            skin.Clear()
        End If
    End Sub
    Sub g_data_for_g()
        If Not (gd.ContainsKey(g)) Then
            If Not (File.Exists("C:\chobits\goals\" & g & ".txt")) Then
                Dim stw As StreamWriter = File.CreateText("C:\chobits\goals\" & g & ".txt")
                stw.Write("5") 'limit of patience
                stw.Close()
                gd.Add(g, 505)
            Else
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\goals\" & g & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gd.Add(g, int1 * 100 + int1)
            End If
        End If
    End Sub
    Sub g_data_for_snew(ByVal x As String)
        Dim str As StreamReader
        str = New StreamReader("C:\chobits\goals\" & x & ".txt")
        Dim int1 As Integer
        Dim tsr As String
        tsr = str.ReadLine()
        str.Close()
        int1 = tsr
        If Not gd.ContainsKey(x) Then
            gd.Add(x, int1 * 100 + int1)
        End If
    End Sub
    Sub g_data_for_p()
        If Not (gd.ContainsKey(p)) Then
            If Not (File.Exists("C:\chobits\goals\" & p & ".txt")) Then
                Dim stw As StreamWriter = File.CreateText("C:\chobits\goals\" & p & ".txt")
                stw.Write("5") 'limit of patience
                stw.Close()
                gd.Add(p, 505)
            Else
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\goals\" & p & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gd.Add(p, int1 * 100 + int1)
            End If
        End If
    End Sub
    Sub gs_data_exist(ByVal g1 As String, ByVal g2 As String)
        If Not (gs.ContainsKey(g1 & g2)) Then
            If Not (File.Exists("C:\chobits\goalsub\" & g1 & g2 & ".txt")) Then
                Dim stw As StreamWriter = File.CreateText("C:\chobits\goalsub\" & g1 & g2 & ".txt")
                stw.Write("$") ' check this reminder
                stw.Close()
                stw = File.CreateText("C:\chobits\emotionvalue\" & g1 & g2 & ".txt")
                stw.Write("5")
                stw.Close()
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\emotionvalue\" & g1 & g2 & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gs.Add(g1 & g2, int1 * 100 + int1)
            Else
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\emotionvalue\" & g1 & g2 & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gs.Add(g1 & g2, int1 * 100 + int1)
            End If
        End If
    End Sub
    Sub gs_data()
        If Not (gs.ContainsKey(g & s)) Then
            If Not (File.Exists("C:\chobits\goalsub\" & g & s & ".txt")) Then
                Dim stw As StreamWriter = File.CreateText("C:\chobits\goalsub\" & g & s & ".txt")
                stw.Write("$")
                stw.Close()
                stw = File.CreateText("C:\chobits\emotionvalue\" & g & s & ".txt")
                stw.Write("5")
                stw.Close()
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\emotionvalue\" & g & s & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gs.Add(g & s, int1 * 100 + int1)
            Else
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\emotionvalue\" & g & s & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gs.Add(g & s, int1 * 100 + int1)
            End If
        End If
        If Not (gs(g & s) Mod 100 = 0) Then
            gs(g & s) -= 1  'decrease reservwar of patience
        End If
        If gs(g & s) Mod 100 > 0 Then
            gs(g & s) += 100 'increase emotion value
        Else
            gs(g & s) = Abs(gs(g & s) - 100) 'decrease emotion value
        End If
    End Sub
    Sub g_data() 'for s
        If Not (gd.ContainsKey(s)) Then
            If Not (File.Exists("C:\chobits\goals\" & s & ".txt")) Then
                Dim stw As StreamWriter = File.CreateText("C:\chobits\goals\" & s & ".txt")
                stw.Write("5")
                stw.Close()
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\goals\" & s & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gd.Add(s, int1 * 100 + int1)
            Else
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\goals\" & s & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                str.Close()
                int1 = tsr
                gd.Add(s, int1 * 100 + int1)
            End If
        End If
        If gd(s) Mod 100 = 0 Then
            sleepybar.Value -= 1
        End If
        If gd(s) Mod 100 > 0 Then
            gd(s) -= 1
            gd(s) += 100
        Else
            gd(s) = Abs(gd(s) - 100)
            gs(g & s) = Abs(gs(g & s) - 100)
        End If
    End Sub
    Sub goalprefrence()
        gs_data_exist(g, goaltemp)
        Dim str As StreamReader
        str = New StreamReader("C:\chobits\goalsub\" & g & goaltemp & ".txt")
        goaltemp = str.ReadLine()
        str.Close()
        p = goaltemp 'p = special counter of goal repitition
        gpref_bool = True
    End Sub
    Sub prophesy()
        Dim str As StreamReader
        str = New StreamReader("C:\chobits\goalsub\" & g & s & ".txt")
        p = str.ReadLine()
        str.Close()
    End Sub
    Sub snew_bank()
        If Not (gs.ContainsKey(s & p)) Then
            If Not (File.Exists("C:\chobits\goalsub\" & s & p & ".txt")) Then
                Dim stw As StreamWriter = File.CreateText("C:\chobits\goalsub\" & s & p & ".txt")
                stw.Write("$")
                stw.Close()
                Dim stw2 As StreamWriter = File.CreateText("C:\chobits\emotionvalue\" & s & p & ".txt")
                stw2.Write("5")
                stw2.Close()
                gs.Add(s & p, 505)
            Else
                Dim str As StreamReader
                str = New StreamReader("C:\chobits\emotionvalue\" & s & p & ".txt")
                Dim int1 As Integer
                Dim tsr As String
                tsr = str.ReadLine()
                int1 = tsr
                gs.Add(s & p, int1 * 100 + int1)
            End If
        End If
        If gs(s & p) Mod 100 > 0 Then
            If Not (snew.ContainsKey(s)) Then
                snew.Add(s, p)
            Else
                snew(s) = p
            End If
        End If
    End Sub
    Sub playaudio(ByVal f1 As String)
        If File.Exists(f1) Then
            My.Computer.Audio.Play(f1, AudioPlayMode.Background)
        Else
            voice.speak(p)
        End If
    End Sub
    Sub methdo(ByVal cx As Char)
        ' does a methode
        Select Case cx
            Case "0"
                'release
            Case "*"
                If ear.Text.Length() = 0 Then
                    ear.Text = TimeString.Substring(0, 5)
                    methodetodo = "0"
                End If
            Case Else
        End Select
    End Sub
    Sub vr() 'virtual reality activates reflexes
        Select Case p
            Case "the time is"
                methodetodo = "*"
            Case "^"
                If (exebank > 0 Or virtualexe > 0) And linger_blocker Then 'check blocker
                    cs = 5 ' check
                End If
                methodetodo = "0"
            Case "volaris" ' switches betwin human and combo brain mode
                If Not RadioButton1.Checked Then 'not human brain mode
                    RadioButton1.Checked = True
                Else
                    RadioButton3.Checked = True ' combo brain mode
                End If
            Case "karenis" ' deletetes all animal goals and sets to human brain mode
                remove_animal_goals()
                RadioButton1.Checked = True
            Case "4"
                methodetodo = "0"
            Case Else

        End Select
    End Sub
    Sub remove_animal_goals()
        lag = "1"
        Dim lag2 As String = "" ' temp lag
        While lag <> ""
            Dim str As StreamReader
            str = New StreamReader("C:\chobits\animal\" & lag & ".txt")
            lag2 = str.ReadLine()
            str.Close()
            File.Delete("C:\chobits\animal\" & lag & ".txt")
            lag = lag2
        End While
        klag = 1
        File.WriteAllText("C:\chobits\animal\1.txt", "")
        animal.Clear()
    End Sub
    Sub action()
        If exebank = 0 Then
            skin.Clear()
        End If
        vr()
        '!^ 0-4 eye 11 char, robotics
        If exebank > 0 Then
            outputedString = p 'voice recognition no glitch
            ear.Text = p
            playaudio("c:\chobits\voice\" & p & ".wav")
            exebank -= 1
            If exebank = 0 Then
                rest = 2
            End If
        Else
            outputedString = ""
            skin.Text = p
            If virtualexe > 0 Then
                playaudio("c:\chobits\voice\" & p & ".wav")
                virtualexe -= 1
                If virtualexe = 0 Then
                    rest = 2
                End If
            End If
        End If
        methdo(methodetodo)
    End Sub
    Sub energy_calibration()
        Dim gslvl As Integer
        gslvl = gs(g & s) \ 100
        If (gslvl > 20 Or p = "!") And Not (exebank = 1 Or virtualexe = 1) Then
            exebank = 2
        ElseIf gslvl > 5 And Not virtualexe > 0 Then
            exebank = 1
        End If
        If formula2 Then
            exebank = 0
        End If
        If cs = 3 And exebank > 0 Then
            virtualexe = exebank
            exebank = 0
        Else
            exebank += virtualexe
            virtualexe = 0
        End If
        If rest > 0 Then
            rest -= 1
            virtualexe = 0
            exebank = 0
        End If 'end if if to else if
        ProgressBar1.Value = 2 * gslvl
        'Timer change emp it up
    End Sub
    Sub cry()
        If gd(g) > 4900 Then
            gd(g) = 606 'or 2015
            p = "!"
        End If
        gs_data_exist(g, s)
        If gs(g & s) > 4900 Then
            gs(g & s) = 606 'or 2015
            p = "!"
        End If
    End Sub
    Sub regret()
        Dim stw As StreamWriter = File.CreateText("C:\chobits\goalsub\" & g & s & ".txt")
        stw.Write(p)
        stw.Close()
    End Sub
    Sub lazycount()
        Dim lazy_lim As Integer = 4
        lazycounter += 1
        If lazycounter > lazy_lim Then
            lazycounter = 1
        End If
    End Sub
    Sub dataexist()
        gs_data_exist(g, s) ' check
        gs_data_exist(g, p)
        gs_data_exist(g, cur)
        gs_data_exist(s, cur)
        gs_data_exist(s, p)
    End Sub
    Sub noglitch() 'certain characters cant be text files
        If cur.Contains("\") Then
            cur = cur.Replace("\", " ")
        End If
        If cur.Contains("/") Then
            cur = cur.Replace("/", " ")
        End If
        If cur.Contains("?") Then
            cur = cur.Replace("?", " ")
        End If
        If cur.Contains("*") Then
            cur = cur.Replace("*", " ")
        End If
        If cur.Contains(":") Then
            cur = cur.Replace(":", " ")
        End If
        If cur.Contains("<") Then
            cur = cur.Replace("<", " ")
        End If
        If cur.Contains(">") Then
            cur = cur.Replace(">", " ")
        End If
        If cur.Contains("|") Then
            cur = cur.Replace("|", " ")
        End If
    End Sub
    Sub noglitch2() 'certain characters cant be text files, the sub unglitches animal
        ' goals aka survival goals
        If TextBox4.Text.Contains("\") Then
            TextBox4.Text = TextBox4.Text.Replace("\", " ")
        End If
        If TextBox4.Text.Contains("/") Then
            TextBox4.Text = TextBox4.Text.Replace("/", " ")
        End If
        If TextBox4.Text.Contains("?") Then
            TextBox4.Text = TextBox4.Text.Replace("?", " ")
        End If
        If TextBox4.Text.Contains("*") Then
            TextBox4.Text = TextBox4.Text.Replace("*", " ")
        End If
        If TextBox4.Text.Contains(":") Then
            TextBox4.Text = TextBox4.Text.Replace(":", " ")
        End If
        If TextBox4.Text.Contains("<") Then
            TextBox4.Text = TextBox4.Text.Replace("<", " ")
        End If
        If TextBox4.Text.Contains(">") Then
            TextBox4.Text = TextBox4.Text.Replace(">", " ")
        End If
        If TextBox4.Text.Contains("|") Then
            TextBox4.Text = TextBox4.Text.Replace("|", " ")
        End If
    End Sub
    Sub input()
        If cs < 3 Then 'add code for eye sense in this sub
            If Not outputedString = "" Then
                cur = outputedString
            Else
                cur = ear.Text
            End If
            ear.Clear()
            If cur = "" Then
                lazycount()
                If lazycounter = 4 Then
                    If exp > 4 Then
                        exp = 0
                    End If
                    cur = exp
                    exp += 1
                    mbool = True
                End If
            Else
                If cur = sear3 Or cur = s2 Then
                    cur = "^"
                End If
            End If
        Else
            If cs = 3 And skin.Text <> s Then
                cur = skin.Text
            Else
                If cs = 3 Then
                    cur = ""
                End If
            End If
        End If
        If cur.Contains("\") Or cur.Contains("/") Or cur.Contains("?") Or cur.Contains(":") Or cur.Contains("*") Or cur.Contains("|") Or cur.Contains("<") Or cur.Contains(">") Then
            noglitch()
        End If
        dataexist()
    End Sub
    Sub feedback()
        If cs < 3 And cur <> "" Then
            If Not cur = "^" Then
                s = cur
                s2 = cur
                sear3 = s2
            Else
                s = cur
            End If
        Else
            s = skin.Text
        End If
    End Sub
    Sub show_extra_data()
        Label1.Text = p 'label1 show prophesy
        If p = "$" Then
            Label1.Text = ""
        End If
        If checkbox1.Checked Then
            Label3.Text = g 'show goal in label3
        End If
    End Sub
    Sub goal_set()
        g = p
        goaltemp = "$"
        g_data_for_g()
        gs_data_exist(g, s)
    End Sub
    Sub think()
        If sleepybar.Value <= 0 Then
            cs = 4
        End If
        If TimeString.Substring(0, 5) = "12:00" Then
            If Not hasSlept Then
                cs = 4
            End If
        Else
            hasSlept = False
        End If
        Select Case cs
            Case 4
                sleep()
                hasSlept = True
            Case 5
                linger()
            Case Else
                input()
                If g = s Then
                    goalprefrence()
                End If
                dataexist()
                If snew.ContainsKey(s) And Not gpref_bool Then
                    gs_data_exist(g, snew(s))
                    gs_data_exist(s, snew(s))
                    If gs(g & p) \ 100 + gs(s & p) \ 100 < gs(g & snew(s)) \ 100 + gs(s & snew(s)) \ 100 And gd(snew(s)) Mod 100 > 0 Then
                        p = snew(s)
                        regret()
                        gs_data_exist(g, p)
                        gs_data_exist(s, p)
                    End If
                End If
                gpref_bool = False 'reset goal prefrence
                If gs(g & p) \ 100 + gs(s & p) \ 100 <= gs(g & cur) \ 100 + gs(s & cur) \ 100 And cur <> "" Then
                    p = cur
                    regret()
                    formula2 = True
                End If
                g_data_for_p()
                If Not RadioButton2.Checked Then 'not animal brain mode
                    If gs(g & s) \ 100 + 1 < gd(p) \ 100 Then
                        goal_set() 'sets a new goal
                    ElseIf RadioButton3.Checked And animal.ContainsKey(p) Then ' combo brain mode
                        goal_set()
                    End If
                ElseIf RadioButton2.Checked And animal.ContainsKey(p) Then 'animal brain enabled
                    goal_set()
                End If
                snew_bank()
                cry()
                energy_calibration() 'output new formula 1
                action()
                feedback()
                dataexist()
                prophesy()
                If ((s = "$") Or (s.Length = 1)) And mbool Then
                    gs_data_exist(g, p)
                    gs_data_exist(g, s)
                    mbool = False
                Else
                    gs_data()
                    g_data() 'for s
                End If
                show_extra_data()
                ' cycle sense
                cs += 1
                If cs > 3 Then
                    cs = 1
                End If
                If p = "$" Then
                    cs = 1
                End If
                formula2 = False
                If skin.Text = ear.Text Then
                    ear.Clear() 'check
                End If
        End Select
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        playaudio("C:\chobits\voice\dragpunch.wav") 'decoration only
        wake()
        If Not File.Exists("C:\chobits\volaris\volaris.txt") Then
            File.WriteAllText("C:\chobits\volaris\volaris.txt", "1")
        End If
        Dim str As StreamReader
        str = New StreamReader("C:\chobits\volaris\volaris.txt")
        volaris = str.ReadLine()
        str.Close()
        Select Case volaris
            Case 1
                RadioButton1.Checked = True
            Case 2
                RadioButton2.Checked = True
            Case Else
                RadioButton3.Checked = True
        End Select
        populate()
    End Sub
    Private Sub sleep1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sleep1.Click
        cs = 4
    End Sub
    Private Sub ear_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ear.TextChanged
        If ear.Text.Contains("/") Then
            ear.Text = ear.Text.Replace("/", "")
            think()
        End If
    End Sub
    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.Checked Then
            TextBox2.Visible = True
            enable.Visible = True
            Label2.Visible = True
        Else
            TextBox2.Visible = False
            enable.Visible = False
            Label2.Visible = False
            linger_blocker = False
        End If
    End Sub

    Private Sub enable_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles enable.Click
        If TextBox2.Text = "moti barski" Then
            linger_blocker = True
        Else
            If TextBox2.Text = "kavagi" Then
                cbStartTic.Visible = True
            ElseIf TextBox2.Text = "choriso sharingan" Then
                checkbox1.Visible = True
            End If
            TextBox2.Visible = False
            enable.Visible = False
            Label2.Visible = False
            linger_blocker = False
        End If
    End Sub

    Private Sub checkbox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles checkbox1.CheckedChanged
        If checkbox1.Checked Then
            Label3.Visible = True
        Else
            Label3.Visible = False
        End If
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        If RadioButton1.Checked Then
            Button4.Visible = False
            Button5.Visible = False
            TextBox4.Visible = False
        End If
        File.WriteAllText("C:\chobits\volaris\volaris.txt", "1")
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        If RadioButton2.Checked Then
            Button4.Visible = True
            Button5.Visible = True
            TextBox4.Visible = True
        End If
        File.WriteAllText("C:\chobits\volaris\volaris.txt", "2")
    End Sub

    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        If RadioButton3.Checked Then
            Button4.Visible = True
            Button5.Visible = True
            TextBox4.Visible = True
        End If
        File.WriteAllText("C:\chobits\volaris\volaris.txt", "3")
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If TextBox4.Text <> "" Then 'the following adds an animal goal
            noglitch2()
            If Not animal.ContainsKey(TextBox4.Text) Then ' new animal goal is added
                File.WriteAllText("C:\chobits\animal\" & klag & ".txt", TextBox4.Text)
                File.WriteAllText("C:\chobits\animal\" & TextBox4.Text & ".txt", "")
                If klag <> "1" Then
                    animal(klag) = TextBox4.Text
                Else
                    animal.Add(TextBox4.Text, "")
                End If
                klag = TextBox4.Text
            End If
            TextBox4.Clear()
        End If
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        remove_animal_goals() ' empties all customized goals that were artificialy added
    End Sub
    Private Sub ear_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ear.KeyUp
        If e.KeyCode = Keys.Enter Then
            think()
        End If
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If ear.Text = "" Then
            If waitBool Then
                If waitMin = Minute(Now) Or (TimeString.Substring(0, 5) = "12:00" And Not hasSlept) Then
                    waitBool = False
                    think()
                End If
            Else
                waitBool = True
                waitMin = Minute(Now)
                waitMin += 10
                If waitMin > 59 Then
                    waitMin -= 60
                End If
            End If
        Else
            waitBool = False
            think()
        End If
    End Sub

    Private Sub cbStartTic_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbStartTic.CheckedChanged
        If cbStartTic.Checked Then
            cbStartTic.Text = "stop to tic"
            Timer1.Enabled = True
        Else
            cbStartTic.Text = "start ticking"
            Timer1.Enabled = False
        End If
    End Sub
End Class
avatar
Moti Barski

Posts : 91
Join date : 2011-08-02

View user profile

Back to top Go down

the yotamarker eye class that was written by Moti Barski

Post  Moti Barski on Sat Apr 14, 2012 2:30 pm

I moti barski do not allow anyone and or anybody and or any organization to receive monetary profit from this yotamarker unless writtenly approved by me personally.

you can use this for research.

31 eye class

Code:
Imports System.IO
Public Class eye
    Public image As Bitmap = Nothing
    Private hd As Integer ' hight
    Private wd As Integer ' width
    Public dark_pixel_rgb As Integer = 20
    Public focus As Integer = 9 ' 0-9 no glitch
    Const dark_marked_pixel_size As Integer = 3
    Private prevEyeString As String = "0123456789t"
    Public eyeling As Boolean
    Private lightSum As Integer ' sums 1st eyechar light
    Private lightAvg As Integer 'lightsum div 5
   
    Private Function lightMaximum(ByVal width As Integer, ByVal height As Integer) As Integer ' returns 1st eyechar max light values
        Dim color As Color
        Dim r, g, b As Integer
        color = image.GetPixel(width, height)
        r = color.R
        g = color.G
        b = color.B
        If r > g And g > b Then
            Return r
        ElseIf g > r And r > b Then
            Return g
        Else
            Return b
        End If
    End Function
    Function image_firstchar() As String
        hd = image.Height()
        wd = image.Width()
        Dim eyestring As String
        eyestring = ""
        lightSum = lightMaximum(wd \ 2, hd \ 2) + lightMaximum(wd \ 2, focus) + lightMaximum(wd - focus - 7, hd \ 2)
        lightSum += lightMaximum(wd \ 2, hd - focus) + lightMaximum(focus, hd \ 2)
        lightAvg = lightSum \ 5
        If is_pixel_dark_at(wd \ 2, hd \ 2) Then
            eyestring &= "1"
        End If
        If is_pixel_dark_at(wd \ 2, focus) Then
            eyestring &= "2"
        End If
        If is_pixel_dark_at(wd - focus - 7, hd \ 2) Then '-7 because my camera has a glitch
            eyestring &= "3"
        End If
        If is_pixel_dark_at(wd \ 2, hd - focus - 30) Then
            eyestring &= "4"
        End If
        If is_pixel_dark_at(focus, hd \ 2) Then
            eyestring &= "5"
        End If
        eyestring = zip_eye_input(eyestring)
        Return eyestring
    End Function
    Function image_10char() As String
        Dim tenchar As String = ""
        Dim temp As String = ""
        hd = image.Height()
        wd = image.Width()
        For i As Integer = 1 To 10
            For j As Integer = 1 To 5
                If is_pixel_dark_at(i * wd \ 11, hd \ 4 + j * hd \ 20) Then
                    mark_dark_pixel(i * wd \ 11, hd \ 4 + j * hd \ 20)
                    temp &= j
                End If
            Next
            tenchar &= zip_eye_input(temp)
            temp = ""
        Next
        Return tenchar
    End Function
    Private Function is_pixel_dark_at(ByVal width As Integer, ByVal height As Integer) As Boolean
        Dim color As Color
        Dim r, g, b As Integer
        color = image.GetPixel(width, height)
        r = color.R
        g = color.G
        b = color.B
        If (r < lightAvg + dark_pixel_rgb) And (g < lightAvg + dark_pixel_rgb) And (b < lightAvg + dark_pixel_rgb) Then
            mark_dark_pixel(width, height)
            Return True
        Else
            Return False
        End If
    End Function
    Private Sub mark_dark_pixel(ByVal width As Integer, ByVal height As Integer)
        For i As Integer = 0 To dark_marked_pixel_size
            For j As Integer = 0 To dark_marked_pixel_size
                Try
                    image.SetPixel(width + j, height + i, Color.Green)
                Catch ex As Exception

                End Try
            Next
        Next
    End Sub
    Private Function zip_eye_input(ByVal zipstring As String) As String 'cerabellum
        Dim result As String '* = ""
        Select Case zipstring
            Case ""
                result = "_"
            Case "12345"
                result = "-"
            Case "1"
                result = "A"
            Case "2"
                result = "B"
            Case "3"
                result = "C"
            Case "4"
                result = "D"
            Case "5"
                result = "E"
            Case "1234"
                result = "F"
            Case "1235"
                result = "G"
            Case "1245"
                result = "H"
            Case "1345"
                result = "I"
            Case "2345"
                result = "J"
            Case "123"
                result = "K"
            Case "124"
                result = "L"
            Case "125"
                result = "M"
            Case "134"
                result = "N"
            Case "135"
                result = "O"
            Case "145"
                result = "#"
            Case "234"
                result = "P"
            Case "235"
                result = "Q"
            Case "245"
                result = "R"
            Case "345"
                result = "S"
            Case "12"
                result = "["
            Case "13"
                result = "T"
            Case "14"
                result = "U"
            Case "15"
                result = "V"
            Case "21"
                result = "W"
            Case "23"
                result = "X"
            Case "24"
                result = "Y"
            Case "25"
                result = "Z"
            Case "34"
                result = "+"
            Case "35"
                result = "{"
            Case "45"
                result = "]"
            Case Else
                result = "_"
                MsgBox(zipstring & " not found in eye shapes bank")
        End Select
        Return result
    End Function
    Private Function eye_decoder(ByVal zipstring As Char) As String 'cerabellum decoder
        Dim result As String '* = ""
        Select Case zipstring
            Case "_"
                result = ""
            Case "-"
                result = "12345"
            Case "A"
                result = "1"
            Case "B"
                result = "2"
            Case "C"
                result = "3"
            Case "D"
                result = "4"
            Case "E"
                result = "5"
            Case "F"
                result = "1234"
            Case "G"
                result = "1235"
            Case "H"
                result = "1245"
            Case "I"
                result = "1345"
            Case "J"
                result = "2345"
            Case "K"
                result = "123"
            Case "L"
                result = "124"
            Case "M"
                result = "125"
            Case "N"
                result = "134"
            Case "O"
                result = "135"
            Case "#"
                result = "145"
            Case "P"
                result = "234"
            Case "Q"
                result = "235"
            Case "R"
                result = "245"
            Case "S"
                result = "345"
            Case "["
                result = "12"
            Case "T"
                result = "13"
            Case "U"
                result = "14"
            Case "V"
                result = "15"
            Case "W"
                result = "21"
            Case "X"
                result = "23"
            Case "Y"
                result = "24"
            Case "Z"
                result = "25"
            Case "+"
                result = "34"
            Case "{"
                result = "35"
            Case "]"
                result = "45"
            Case Else
                result = "_"
                MsgBox(zipstring & " not found in eye decoder shapes bank")
        End Select
        Return result
    End Function
    Public Function sharingan(ByVal s1 As String, ByVal p1 As String) As String 'return motion direction
        ' for 1st eye char up down... edges of image
        ' *add motion detection for eyechars 2-11 (string index 1-10)
        Dim ds1 As String ' decoded s1 1st eye char
        Dim dp1 As String ' decoded p1 1st eye char
        ds1 = eye_decoder(s1(0))
        dp1 = eye_decoder(p1(0))
        Dim result As String = "what the"
        If (dp1.Contains("2") And Not ds1.Contains("2")) Or (Not dp1.Contains("2") And ds1.Contains("2")) Then
            result = "up" ' speed up timer tick interval shorter
        ElseIf (dp1.Contains("4") And Not ds1.Contains("4")) Or (Not dp1.Contains("4") And ds1.Contains("4")) Then
            result = "down" ' speed 0 timer tick interval set to maximum
        ElseIf s1(1) <> p1(1) Then
            result = "Left lv1"
        ElseIf s1(6) <> p1(6) Then
            result = "right lv1"
        ElseIf (dp1.Contains("5") And Not ds1.Contains("5")) Or (Not dp1.Contains("5") And ds1.Contains("5")) Then
            result = "Left"
        ElseIf (dp1.Contains("3") And Not ds1.Contains("3")) Or (Not dp1.Contains("3") And ds1.Contains("3")) Then
            result = "right"
        ElseIf (dp1.Contains("1") And Not ds1.Contains("1")) Or (Not dp1.Contains("1") And ds1.Contains("1")) Then
            result = "middle" ' slow down timer tick interval longer
        ElseIf s1(2) <> p1(2) Then
            result = "Left lv2"
        ElseIf s1(7) <> p1(7) Then
            result = "rightlv2"
        ElseIf s1(3) <> p1(3) Then
            result = "Left lv3"
        ElseIf s1(8) <> p1(8) Then
            result = "right lv3"
        ElseIf s1(4) <> p1(4) Then
            result = "Left lv4"
        ElseIf s1(9) <> p1(9) Then
            result = "right lv4"
        ElseIf s1(5) <> p1(5) Then
            result = "Left lv5"
        ElseIf s1(10) <> p1(10) Then
            result = "right lv5"
        Else
            result = "still"
        End If
        Return result
    End Function
    Sub eyeLinger(ByVal lastEyeString As String)
        eyeling = prevEyeString = lastEyeString
        prevEyeString = lastEyeString
    End Sub
End Class

I also call this eye class A.eye
avatar
Moti Barski

Posts : 91
Join date : 2011-08-02

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum