Can I do the same thing with kojo script
Yes, you can programatically control geogebra from Kojo via scala scripts. The bridge is the Mw object in Kojo.
For example, try this script:
Mw.variable("m", 1, -5, 5, 0.1, 50, 50)
Mw.variable("c", 0, -2, 2, 0.1, 50, 80)
Mw.evaluate("y = m x + c")
To see more examples, look (in the script editor) at the scripts for Help -> Kojo Overview and Samples -> Math Learning Modules -> Solving Linear Equations (run these scripts, and then search for Mw. in the script editor)
Code completion on the Mw object (type Mw. and then Ctrl+Space) will show you what's available for geogebra interaction.
Or you can look at the Mathworld class (of which the above Mw is an instance) to see what's inside in more detail:
Hope that helps. Feel free to ask more questions.