Jump to content

[Auto Answers] Could use some help with script


 Share

Go to solution Solved by SOLVE-SMART,

Recommended Posts

Hi fellow auto-itters :)

During the course of months I've been putting together a script (with some help from you guys before) to function as a knowledge base/auto answering script for (in this case) e-mails.

I've used it for some time and now I'm running into trouble when the list of answers is getting longer and longer. I've posted the full script below with a sample answers.ini file to test with.

My question is the following:   I'm looking for an easier way to store the answers with some more advanced functionalities (I have to type <enter> in the lines to create a line break, and would like to just paste any answer I've previously given into a text file for example to use as an answer including maybe working hyperlinks, bold text, etc)

I'm not a programmer so I'm struggling with ideas on how to achieve this. Is there anyone here who might be willing to help me out a bit by either pointing me in the right direction(s) or preferably adding a little coding to the existing script to enable more functionality (or database, or multiple txt file storage or anything that could help with the question above)?

Any help would be greatly appreciated!

Janjaap

(The Netherlands)

answers.au3 answers.ini

Link to comment
Share on other sites

1 hour ago, barkeeper said:

now I'm running into trouble when the list of answers is getting longer and longer

Define what is the trouble you are facing.  Define longer.  Let first start with this issue as it will drive your other technical directions.

Link to comment
Share on other sites

2 hours ago, barkeeper said:

 would like to just paste any answer I've previously given into a text file for example to use as an answer

Func _SendEx($ss)
    Local $iT = TimerInit()
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
        If TimerDiff($iT) > 2000 Then
            MsgBox(262144, "Warning", "Shift, Ctrl and Alt keys need to be released to proceed!")
            $iT = TimerInit() ; reset the timer
        EndIf
    WEnd
    ;Send($ss)
    FileWrite(".\answers.txt",$ss&@CRLF);;save answers into file answers.txt
    $search = "" ;Reset string
EndFunc   ;==>_SendEx

 

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to comment
Share on other sites

2 hours ago, Nine said:

Define what is the trouble you are facing.  Define longer.  Let first start with this issue as it will drive your other technical directions.

well, basically I have no clue how to handle this, but would like the .ini file to either contain the option to just paste answers, or multiple txt files (by name?) to use.

Link to comment
Share on other sites

Define longer : hundreds, thousands, millions ?

I am having a hard time understanding your trouble, when you say you have no clue.  WHAT is the issue ?  Please explain the problem...

BTW. Use code tag that as described in the link when you post code. Thanks.

Link to comment
Share on other sites

1 minute ago, Nine said:

Define longer : hundreds, thousands, millions ?

I am having a hard time understanding your trouble, when you say you have no clue.  WHAT is the issue ?  Please explain the problem...

BTW. Use code tag that as described in the link when you post code. Thanks.

Ok, I'll try

Currently the script uses answers.ini for "answers" to e-mails or whatever, it's like a knowledge base

I would like to use seperate files per answer, with the script automatically scanning a dir for what "txt" files are in that folder as answers if possible.

so I create a .txt file named "VPN.txt" in the folder for answers, the script at start scans and knows there is an answer called "VPN" and it documents this if I start typing (like it does now) if I select it, it pasts the contents of VPN.txt in the box I have currently selected.


Does that make more sense?

Link to comment
Share on other sites

3 hours ago, barkeeper said:

now I'm running into trouble when the list of answers is getting longer and longer.

 

2 hours ago, Nine said:

Define what is the trouble you are facing.  Define longer.  Let first start with this issue as it will drive your other technical directions

@barkeeper : I fully agree with what @Nine has written.

As far as I understand your intention is to create a knowledge base. Therefore, the most suitable solution seems to be the use of a database, e.g. SQLIte. You probably have the INI-file in the back of your mind, since you are somewhat familiar with it ;).

In the longer run, meaning when the amount of data increases and new functionalities come into play, SQLite offers a much higher level of flexibility (advanced search and filtering capabilities, etc.). Of course, this means that you will have to spend some time with this new topic. Finally, however, this time investment will pay off, because sooner or later you will end up in a dead alley with the INI approach.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

9 minutes ago, Musashi said:

 

@barkeeper : I fully agree with what @Nine has written.

As far as I understand your intention is to create a knowledge base. Therefore, the most suitable solution seems to be the use of a database, e.g. SQLIte. You probably have the INI-file in the back of your mind, since you are somewhat familiar with it ;).

In the longer run, meaning when the amount of data increases and new functionalities come into play, SQLite offers a much higher level of flexibility (advanced search and filtering capabilities, etc.). Of course, this means that you will have to spend some time with this new topic. Finally, however, this time investment will pay off, because sooner or later you will end up in a dead alley with the INI approach.

Would you be able to give me any help on how to set that up? I'm not nearly good enough to get that started :(

Link to comment
Share on other sites

3 minutes ago, barkeeper said:

Would you be able to give me any help on how to set that up? I'm not nearly good enough to get that started :(

Honest Reply : Since the work is currently piling up on my desk, I unfortunately do not have enough time for this :(.

How to install SQLite is well documented (just consult your favorite search engine ;)) , furthermore there are various tutorials (also for novices).

It also depends to a large extent on how sophisticated you want to design your knowledge base. For a limited application your approach may even be sufficient.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

1 hour ago, Musashi said:

Honest Reply : Since the work is currently piling up on my desk, I unfortunately do not have enough time for this :(.

How to install SQLite is well documented (just consult your favorite search engine ;)) , furthermore there are various tutorials (also for novices).

It also depends to a large extent on how sophisticated you want to design your knowledge base. For a limited application your approach may even be sufficient.

It's going to get bigger over time, but for the first run 40-50 entries is enough

Link to comment
Share on other sites

1 hour ago, barkeeper said:

but for the first run 40-50 entries is enough

Finally got a number !!!  At that level, there is no need to embark in using a RDBMS.  In the very very long run, you may wish to convert it to a DB, but for now, let just stay with a single txt file well organized.  With a SRE perfectly adapted to your request, it will take about 1 ms to get the answer.  So for now, you will need to prepare for us a few of those real questions based on a real repertory of knowledge (not just test and useless stuff)  and the real expected result.  Based on that, we will be able to provide some guidances and maybe a startup code for you.

Link to comment
Share on other sites

24 minutes ago, Nine said:

Finally got a number !!!  At that level, there is no need to embark in using a RDBMS.  In the very very long run, you may wish to convert it to a DB, but for now, let just stay with a single txt file well organized.  With a SRE perfectly adapted to your request, it will take about 1 ms to get the answer.  So for now, you will need to prepare for us a few of those real questions based on a real repertory of knowledge (not just test and useless stuff)  and the real expected result.  Based on that, we will be able to provide some guidances and maybe a startup code for you.

I will gladly give you those examples first thing in the morning, it’s passed midnight here at the moment. Thanks in advance for all the help, and all the help already. I’m greatly appreciating it! 

Link to comment
Share on other sites

10 hours ago, Nine said:

Finally got a number !!!  At that level, there is no need to embark in using a RDBMS.  In the very very long run, you may wish to convert it to a DB, but for now, let just stay with a single txt file well organized.  With a SRE perfectly adapted to your request, it will take about 1 ms to get the answer.  So for now, you will need to prepare for us a few of those real questions based on a real repertory of knowledge (not just test and useless stuff)  and the real expected result.  Based on that, we will be able to provide some guidances and maybe a startup code for you.

Hi again, One of the knowledge base items that I would like to be able to send through an "answer" would be this...
I have redacted some of the information:
 

Hi,

To connect to your personal and department drive you need to have an active (edu) VPN connection.


More information can be found here:

https://www.utwente.nl/en/service-portal/hardware-software-network/network-eduroam-vpn-etc/vpn-eduvpn/vpn-for-windows-eduvpn#

With kind regards,
Janjaap

Servicedesk ICT | Library, ICT Services & Archive (LISA) | University of Twente T: +31 (0)53-489 **** | e-mail@utwente.nl | www.utwente.nl/lisa  | Building: Citadel

It would be nice if the system can work with automatic enters/line breaks based on how it's notated in the answers.ini file. a start and or end "tag" would not be a problem.

For example:

[VPN]

Answer with linebreaks

[/VPN]

 

Link to comment
Share on other sites

Ok, I believe I understand what you are after.  Let's say a user of your knowledge base system enters VPN, you would like to show him/her the answer you have written in your previous example.  So you need to store those answers like it was a small text, one text for each answer, right ?  I think you would also need to introduce synonyms, where VPN or Network or Connection would give the same answer (maybe my example is not perfect, but I trust you will understand what I mean) ?

One option would be to create a kind of tree view of subjects that would enable users to easily find what they are looking for, instead of letting users enter text they are not sure how to write ? 

I like your idea of storing the answers (text) within some form of tags.  Each element in the tree view would point to a tag that could be read in real time...

Am I understanding you correctly ?

Link to comment
Share on other sites

2 hours ago, Nine said:

Ok, I believe I understand what you are after.  Let's say a user of your knowledge base system enters VPN, you would like to show him/her the answer you have written in your previous example.  So you need to store those answers like it was a small text, one text for each answer, right ?  I think you would also need to introduce synonyms, where VPN or Network or Connection would give the same answer (maybe my example is not perfect, but I trust you will understand what I mean) ?

One option would be to create a kind of tree view of subjects that would enable users to easily find what they are looking for, instead of letting users enter text they are not sure how to write ? 

I like your idea of storing the answers (text) within some form of tags.  Each element in the tree view would point to a tag that could be read in real time...

Am I understanding you correctly ?

I'm so sorry, but no, let me clarify:  I work for a servicedesk (at a University) and we struggle with not enough people to answer e-mails or other repeating questions (at the moment we type everything by hand without using a knowledge base or wiki or anything that can store knowledge) What I would like to create (to help us out a lot) is a small system that we can run in our tray, that stores answers to questions we get asked a lot, so we can press "reply" on an e-mail, press ctrl+1 select an answer that we've previously given (and have prepared in the answers.ini file or something like that) so that we can answer questions that are asked a lot, a lot quicker.

ps. It would just be for the agents here, no need to post anything external. So for example we get a question about "how to install the VPN" on monday, we type that answer but also copy/paste it into the "answers.ini". Next time someone asks us how the VPN is installed we can just do ctrl+1, type VPN, it pasts that previous answer into the e-mail, press send and we're done. like I said before, right now we type a new mail every single time someone asks a question and it takes so much time. If we would have this system for say 50 most common questions, it would save us a lot of time. But because my colleagues don't know what specific "tag" I used to store the knowledge, the current system searches for tags that come close to what I typed (this also helps a lot)

Edited by barkeeper
Link to comment
Share on other sites

Alright, got the picture now.  Thanks for a well explained requirement.  Just a few more questions : How many are you in the service desk ?  Are they familiar with technology or are they truly novices ?  Do you feel confident to let them manipulate a txt file directly or should you automate the update of the file when a new answer is created ?

Link to comment
Share on other sites

6 hours ago, Nine said:

Alright, got the picture now.  Thanks for a well explained requirement.  Just a few more questions : How many are you in the service desk ?  Are they familiar with technology or are they truly novices ?  Do you feel confident to let them manipulate a txt file directly or should you automate the update of the file when a new answer is created ?

We’re 7 at the moment, and not familiair with auto it, technical things in general ofcourse yes, and could help them. They can manipulate the file; that’s fine. Could also use a ‘central’ file on a backup location

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...