Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script for programming phone 2

Status
Not open for further replies.

forcetranquille

Technical User
Feb 13, 2006
218
FR
Hi,

Does anyone have any scripts that they would shared for programming phone with excel file or text file

Thanks a lot
 
yes, are you looking for new sets with mail features? best way to script that is to use the copy command and pull the key 0 and tn from a txt and then let the same script make the changes such as rnpg ncos des key 1 etc, much faster then a script with 31 returns.. those can be a problem with a txt source,, due to the fact the script is looking for details in the script that is a return for some but not all phones.. i can post a simple script as an outline with a few pointer but in most cases you'll need to modify it for your exact app... i have maybe 400 scripts and most of the time i modify a script for most projects.. on a recent progect, we scripted 200 3904's all ncos 0 with a hot d 4 xxxx to an auto answer dn in the switchroom.. installers did random patches, picked up a set, gave me the dn, i did a trace, (with a trace key) the change from that point took under 40 seconds... added 3 mcr keys and either mail or not and set the rnpg and ncos to the correct settings.. the script stopped for ncos and rnpg. just an example of the way i build a script that works for the app...

john poole
bellsouth business
columbia,sc
 
thank johnpoole for your reply. Can you post a simple script for use with excel.

bye bye
 
excel requires a dll link and gets real deep real fast, i built one, decided it wasn't worth the tweaking and now i do a save as, either a tab or comma delimited. i then do a copy (the txt) and paste that into the procomm editor.. that keeps me from getting extra returns.. when you copy from a excel and paste, you get a free return, you don't when you copy from a txt (wud).. here is one i have used that will help you get started.. it's a basic building for a 3904

Code:
proc main

   string sline, tn,key0,cpnd,key1,key2

   fopen 0 "3904.txt" READ    ;Open our data file
   while not feof 0           ;While the file still has data
      fgets 0 sLine           ;Read a line of data
      strtok tn sLine "`t" 1    ;Get the first field
      strtok key0 sLine "`t" 1  ;Get the second field
      strtok cpnd sLine "`t" 1  ;Get the third field
      strtok key1 sLine "`t" 1  ;Get the fourth field
      strtok key2 sLine "`t" 1  ;Get the fifth field
     ; strtok sTemp3 sLine "`t" 1  ;Get the sixth field
  
  set txpace 30
  waitfor "req:"
   transmit "new^M"
  waitfor "type"
   transmit "3904^M" 
  waitfor "tn  "
   transmit tn
   transmit "^M"
  waitfor "des"
   transmit "xxxx^M"
  waitfor "CUST"
   transmit "0^M"
  waitfor "KBA"
   transmit "^M"
  waitfor "dba"
   transmit "^M"
 waitfor "fdn"
   transmit "xxxxx^M"
 waitfor "tgar"
   transmit "^M"
 waitfor "ldn"
   transmit "^M"
 waitfor "ncos"
   transmit "5^M"
 waitfor "rnpg"
   transmit "^M"
 waitfor "ssu"
   transmit "^M"
 waitfor "xlst"
   transmit "^M"
 waitfor "sgrp"
   transmit "^M"
 waitfor "cls"
   transmit "LNA FNA HTA HFA MWA CNDA DNDA CFXA FTTU AHA^M"
 waitfor "rco"
   transmit "^M"
 waitfor "hunt"
   transmit "xxxxx^M"
 waitfor "lhk"
   transmit "0^M"
 waitfor "lnrs"
   transmit "^M"
 waitfor "sci"
   transmit "^M"
 waitfor "plev"
   transmit "^M"
 waitfor "ast"
   transmit "^M"
 waitfor "iapg"
   transmit "^M"
 waitfor "mlwu_lang"
   transmit "^M"
 waitfor "mlng"
   transmit "^M"
 waitfor "dndr"
   transmit "^M"
 waitfor "key  "
   transmit key0
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "new^M"
 waitfor "name  "
   transmit cpnd
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key  "
   transmit key1
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key  "
   transmit key2
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key"
   transmit "3 adl^M"
 waitfor "key"
   transmit "4 adl^M"
 waitfor "key"
   transmit "5 adl^M"
 waitfor "key"
   transmit "6 csd^M"
 waitfor "key"
   transmit "7 adl^M"
 waitfor "key"
   transmit "8 adl^M"
 waitfor "key"
   transmit "9 adl^M"
 waitfor "key"
   transmit "10 adl^M"
 waitfor "key"
   transmit "11 adl^M"
 waitfor "key"
   transmit "16 mwk xxxxx^M"
 waitfor "key"
   transmit "24 nul^M"
 waitfor "key"
   transmit "25 nul^M"
 waitfor "key"
   transmit "26 nul^M"
   
  
   endwhile
   
   fclose 0

   
endproc

that one is a non mail with ncos allowing ld without a fac code in my switch.. like i psoted i modify it for each project, most of my scripts are very simple but save time. note from the the strtok line, this file opens a tab delimited file..

john poole
bellsouth business
columbia,sc
 
here's a simple script using the meta keys.. i program all my copies of procomm with metakey alt 2 to be paste text... then i trace a call with a trc key or just prt the dn and copy the tn using the mouse... then (from a meta key) i start this script.. as you can see it adds mail to an 04 plus a few cls marks that are not default that i like to use... the pause 2 give me plenty time to alt period to stop the script if the station is busy. i could write a loop while if target but i don't usually tie up my screen for the loop time. alt m brings up the meta keys, they are handy for starting scripts or menu command short cuts and with 40 meta keys, they save time.. alt 0 here in the switchroom stops for the password then completes the logi and syncs the time to the networked pc... this may be one of the few sites around where the pc clock and the switch match to the second... if you have trouble with these let us know...

Code:
proc main
  
   transmit "****^M"
   waitfor ">"
   transmit "ld 11^M"
   waitfor "REQ: "
   TRANSMIT "STAT "
   metakey alt 2
  pause 2
  
   transmit "disu "
   metakey alt 2
   waitfor "REQ: "
   transmit "chg^M"
   waitfor "TYPE: "
   transmit "3904^M"
   waitfor "TN  "
   metakey alt 2
   waitfor "ECHG "
   transmit "yep^M"
   waitfor "ITEM "
  
   transmit "hunt 3301^M"
   waitfor "ITEM "
   transmit "cls hta mwa fna cmda tdd dnda ^M"
   waitfor "ITEM "
   transmit "fdn 3301^M"
   waitfor "ITEM "
   transmit "key 16 mwk 3301^M"
   waitfor "     KEY "
   transmit "^M"
   waitfor "ITEM "
   transmit "^M"
endproc

john poole
bellsouth business
columbia,sc
 
If I have a excel file with 300 Analog TNB's that a want to import into a script that will chg the NCOS to 1 and chg cls to CTD and LPA etc. how do you do this? Still trying to learn ProComm.
 
John,

How do you tell the script to take from the Excel spread sheet?

Thanks
Mal
 
i used to take the time to build a ddl link to the excel, but it's quicker to save the file as a comma delimited, then "fopen 0 "3904.txt" READ" is all that is required to do the get file.. over on the aspect forum, knob has a link to his website with examples of links to excel and i have used them.. but for day to day scripts, this method is faster for me to work with...you want some very clean scripts, do a search for firebird scrambler's post, his stuff is polished with radio buttons, get input lines, get target links, i've used a lot of his work with modifications to fit my apps

john poole
bellsouth business
columbia,sc
 
hey jpoole i tried the first script but it doesnot grab the infofrom the text file what am i doing wrong i copied from yours
 
you have a txt with the same name in the same directory as the .was? unlike the commerical programers, i don't include pop-ups that give help.. but if you do to script edit and look at complile options you can ask for debug help and when the script fails you will at least see what's it's waiting for.. i'll re-paste it monday and see if it fails.. i used that script for a couple hundred sets on the new heart center without a problem.. but since i edit all my scripts as i need changes,i'll be glad to recheck that one..

john poole
bellsouth business
columbia,sc
 
jpoole
yes the txt and the was are same name same directory thanks for the reply back and ill check back monday
 
jpoole
did you get a chance to try this to see if it worked
 
i'll pull that one up, monday was a killer here. had a dept move over the weekend, the two techs that did the move did a good job, the dept head wanted 40 changes monday morning. since changes are free for depts here, we do a lot of free work

john poole
bellsouth business
columbia,sc
 
here's a new copy, works like a champ, pulls the 5 varaibles from the tab delimited txt.. make sure you do not have a blank line at the top (or anywhere) in the txt file

Code:
proc main

   string sline, tn,key0,cpnd,key1,key2

   fopen 0 "3904.txt" READ               ;Open our data file
   while not feof 0                       ;While the file still has data
      fgets 0 sLine                       ;Read a line of data
      strtok tn sLine "`t" 1          ;Get the first field
      strtok key0 sLine "`t" 1          ;Get the second field
      strtok cpnd sLine "`t" 1          ;Get the third field
      strtok key1 sLine "`t" 1          ;Get the fourth field
      strtok key2 sLine "`t" 1          ;Get the fifth field
     ; strtok sTemp3 sLine "`t" 1          ;Get the sixth field
  
  set txpace 30
  waitfor "req:"
   transmit "new^M"
  waitfor "type"
   transmit "3904^M" 
  waitfor "tn  "
   transmit tn
   transmit "^M"
  waitfor "des"
   transmit "xxxx^M"
  waitfor "CUST"
   transmit "0^M"
  waitfor "KBA"
   transmit "^M"
  waitfor "dba"
   transmit "^M"
 waitfor "fdn"
   transmit "xxxxx^M"
 waitfor "tgar"
   transmit "^M"
 waitfor "ldn"
   transmit "^M"
 waitfor "ncos"
   transmit "5^M"
 waitfor "rnpg"
   transmit "^M"
 waitfor "ssu"
   transmit "^M"
 waitfor "xlst"
   transmit "^M"
 waitfor "sgrp"
   transmit "^M"
 waitfor "cls"
   transmit "LNA FNA HTA HFA MWA CNDA DNDA CFXA FTTU AHA^M"
 waitfor "rco"
   transmit "^M"
 waitfor "hunt"
   transmit "xxxxx^M"
 waitfor "lhk"
   transmit "0^M"
 waitfor "lnrs"
   transmit "^M"
 waitfor "sci"
   transmit "^M"
 waitfor "plev"
   transmit "^M"
 waitfor "ast"
   transmit "^M"
 waitfor "iapg"
   transmit "^M"
 waitfor "mlwu_lang"
   transmit "^M"
 waitfor "mlng"
   transmit "^M"
 waitfor "dndr"
   transmit "^M"
 waitfor "key  "
   transmit key0
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "new^M"
 waitfor "name  "
   transmit cpnd
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key  "
   transmit key1
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key  "
   transmit key2
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key"
   transmit "3 adl^M"
 waitfor "key"
   transmit "4 adl^M"
 waitfor "key"
   transmit "5 adl^M"
 waitfor "key"
   transmit "6 csd^M"
 waitfor "key"
   transmit "7 adl^M"
 waitfor "key"
   transmit "8 adl^M"
 waitfor "key"
   transmit "9 adl^M"
 waitfor "key"
   transmit "10 adl^M"
 waitfor "key"
   transmit "11 adl^M"
 waitfor "key"
   transmit "16 mwk xxxxx^M"
 waitfor "key"
   transmit "24 nul^M"
 waitfor "key"
   transmit "25 nul^M"
 waitfor "key"
   transmit "26 nul^M"
   
  
   endwhile
   
   fclose 0

   
endproc

here is the txt file i built this morning to test with. those phones took maybe 2 minutes... now i need a script to take them out..
Code:
112 1 0 3	2083	jim	trn	adl
112 1 0 4	2171	joe	trn	adl
112 1 0 5	2963	jill	trn	adl


not rocket science, but saves me time..

john poole
bellsouth business
columbia,sc
 
THE SCRIPT IS PUTTING THE TN AND KEY 0 IN THE SAME LINE OF THE TN WHEN RUNNING THE SCRIPT
 
strtok tn sLine "`t" 1 that tells the script is tab delimited, i haven't had that problem when saving as a tab delimited and then do a copy all then paste that into the aspect editor.. might try to use comma delimited, depending on some of your pc attributes, they make work cleaner the tab... i have had to use tab when using aspect editor, once in a while the script will transmit the ,.. changing "t" to "," defines the separator.. if aspect sees the tab as 6 spaces, it will transmit both tn and dn on the same line. let me post a simple one liner that i use a lot, start from that and build up

john poole
bellsouth business
columbia,sc
 
this is one i change all the time for simple changes.
Code:
Proc main

  
   
   
   string tn
  	;string dn
   
   integer count
   string szline
   fopen 0 "ncos.wud" read

   while not feof 0
   SZLINE = "2"
   fgets 0 szline

    strtok ncos szline ","  1   ;columns in the csv file
    ;strtok dn szline ","  1 
   set txpace 30
   
   
   waitfor "REQ: "
   transmit "chg^M"
   waitfor "TYPE: "
   transmit "3904^M"
   waitfor "TN "
  
    transmit tn
  
   
   transmit "yep^M"
   ;mspause 30
  
   mspause 50
   transmit "ncos 1^M"
   ;waitfor "ITEM "
   ;transmit "cls hfa lna tdd cnda ddga nama ^M"
   waitfor "ITEM "
   transmit "^M"
    
  waitfor "REQ: "
   

 
   
   
  
    count += 2
   endwhile
   fclose 0
   fclose 1
   call main

this was one i ran for a list of 3904's that i wanted to all have the same cls marks.. they were added by 3 techs over a few months time, instead of having troubles called in one at a time, i ran this script to make them all match. you can see were i used ; to take that line out of service, that lets me modify a script on an as needed condition... once i got this one to work on my machine i started adding lines... after you get the 1st one to work, you get a little brave...

john poole
bellsouth business
columbia,sc
 
you are the man, later this month you may be my new boss

john poole
bellsouth business
columbia,sc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top