Jump to content

Needing help making a very basic script


Recommended Posts

Hello all, i'm a complete newbie to AutoIt and I have never actually made a script for it ever. So i've got a question for a script i'd like to make.

I moderate and do work on a wiki page for a forum I go on, and it recently got hacked and i'm trying to rebuild it. And i'm able to view the old wiki and all the information via google cache but I can't actually edit the page and view the source of the formatting. So this means I have to do all the formatting of EVERYTHING by hand. So this is where I thought AutoIt could be of some help but I have no idea how to script.

Basically i'd like a script that when I click somewhere in text it backspaces six times, makes an asterik, then two left brackets after that. Like this.

*[[Testing 1 2 3 4

Because by default when i'm trying to format the wiki everything is like this

* Testing 1 2 3 4

And would it be possible to run another script so when I click it adds two right brackets? Because I need most of the sections to look like this.

*[[Testing 1 2 3 4]]

But I can always just paste the two right brackets over everything so I don't think it would be a big deal. Also sorry if this sounds kind of confusing.

Link to comment
Share on other sites

This should do the trick. When you press 1 on the numpad it will do the 6 backspaces and send the *[[. Numpad 2 will do the ]] thing :P.

HotKeySet("{NUMPAD1}", "_AddFirst")
HotKeySet("{NUMPAD2}", "_AddSecond")

While 1
    
WEnd

Func _AddFirst()
    Send("{BACKSPACE 6}")
    Send("*")
    Send("[[")
EndFunc

Func _AddSecond()
    Send("]]")
EndFuncoÝ÷ Ù.q©Ü©àzØ^nëm¢vòr§è§Ø^J{$¶«jg­z»¢·±jjez'ò¢ì׶!jx×ë¢cnÖÚ-é^¶×«Yú+{¦¦W­ébì(ºWe¢%G­+ºÚ"µÍÝÙ^TÙ]
    ][ÝÝÉ][ÝË  ][Ý×ÐYÝ ][ÝÊ
Edited by Marlo
Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
Link to comment
Share on other sites

Here you go

HotKeySet("{NUMPAD1}", "_AddFirst")
HotKeySet("{NUMPAD2}", "_AddSecond") 
HotKeySet("{NUMPAD3}", "_AddThird")

While 1
   
WEnd

Func _AddFirst()
    Send("{BACKSPACE 6}")
    Send("*")
    Send("[[")
EndFunc

Func _AddSecond()
    Send("]]")
EndFunc
Func _AddThird()
    Send("{DOWN}")
    Send("{RIGHT 3}")
EndFunc
Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
Link to comment
Share on other sites

That seems like a waste of time, you could use End after "[[" and then do "]]" and make it all one func, like this:

Func _AddFirst()
    Send("{BACKSPACE 6}")
    Send("*")
    Send("[[")
    Send("{END}")
    Send("]]")
EndFunc
Edited by AdmiralAlkex
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...